| | |
vb6 - RunTime error 1004 Invalid number of arguments
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
Hello everybody,
my program have been working and today I'm getting run time error 1004 - invalid number of arguments on this line of code:
Also, I am getting a "Runtime error 1004 - unable to set the RowHeight Property of the range class" on this code:
Can anyone tell me what went wrong?
Below is my entire procedure:
Thanks.
tgifgemini
my program have been working and today I'm getting run time error 1004 - invalid number of arguments on this line of code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
mystr = "Comments:" & "'" & xlApp.Clean(Trim(rsin![Comments]))
Also, I am getting a "Runtime error 1004 - unable to set the RowHeight Property of the range class" on this code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
RowHeight = .Font.Size * (Len(xlWksht.Range("A" & ii + 1).text) - Len("Comments:")) / w + rht + (rht - .Font.Size) + newlinecnt * .Font.Size
Can anyone tell me what went wrong?
Below is my entire procedure:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
ii = 5 w = 0 For Each R In xlWksht.Range("A8:h8"): w = w + R.ColumnWidth: Next rht = xlWksht.Range("A6").RowHeight Do Until rsin.EOF = True ii = ii + 2 xlWksht.Cells(ii, 1).Value = rsin![Req No] xlWksht.Cells(ii, 2).Value = rsin![Description] xlWksht.Cells(ii, 3).Value = rsin![P L] & Chr(10) & rsin![Pgmr2] & Chr(10) & rsin![Pgmr3] xlWksht.Cells(ii, 4).Value = rsin![ClientName] & Chr(10) & rsin![Status] xlWksht.Cells(ii, 5).Value = "-" & Chr(10) & rsin![Per Hrs] xlWksht.Cells(ii, 6).Value = rsin![Hours] & Chr(10) & rsin![Tot Hrs] xlWksht.Cells(ii, 7).Value = rsin![Start Date] & Chr(10) & rsin![Start Date] xlWksht.Cells(ii, 8).Value = rsin![End Date] & Chr(10) & rsin![End Date] 'xlWksht.Cells(ii + 1, 1).Value = "Comments:" & Chr(10) & "'" & xlApp.Clean(Trim(rsin![Comments])) mystr = "Comments:" & "'" & xlApp.Clean(Trim(rsin![Comments])) Do Pos = InStr(Pos + 1, mystr, ":") If Not Pos = 0 Then If Mid(mystr, Pos - 5, 1) = "/" Then mystr = Left(mystr, Pos - 11) & Chr(10) & Mid(mystr, Pos - 10, 10) & Chr(10) & Mid(mystr, Pos + 1) newlinecnt = newlinecnt + 2 Pos = Pos + 2 End If End If Loop While Not Pos = 0 xlWksht.Cells(ii + 1, 1).Value = mystr 'xlWksht.Range("A12").Value = mystr With xlWksht.Range(xlWksht.Cells(ii + 1, 1), xlWksht.Cells(ii + 1, 8)) .HorizontalAlignment = xlLeft .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .Borders(xlEdgeBottom).LineStyle = xlContinuous .Borders(xlEdgeBottom).Weight = xlThin .IndentLevel = 0 .MergeCells = True .RowHeight = .Font.Size * (Len(xlWksht.Range("A" & ii + 1).text) - Len("Comments:")) / w + rht + (rht - .Font.Size) + newlinecnt * .Font.Size End With rsin.MoveNext Loop
tgifgemini
•
•
Join Date: Jul 2007
Posts: 113
Reputation:
Solved Threads: 0
Problem solved.
The "Comments" field in my input table had null values, so I fixed it with this code:
Thanks.
tgif
The "Comments" field in my input table had null values, so I fixed it with this code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If rsin![Comments] = "" Or IsNull(rsin![Comments]) Then mystr = "Comments:" & Chr(10) & "NO COMMENTS FOR THIS RECORD!" Else mystr = "Comments:" & "'" & xlApp.Clean(Trim(rsin![Comments])) End If
tgif
![]() |
Similar Threads
- Runtime Error - '-2147217904(800440e10) Help to Correct this (Visual Basic 4 / 5 / 6)
- Microsoft VBScript runtime error 800a0005 (ASP)
- Run-Time error 1004 - Unable to set the RowHeight property of the range class (Visual Basic 4 / 5 / 6)
- VB6 Runtime error 7 Out of memory (Visual Basic 4 / 5 / 6)
- VB6 - Look up email address from outlook address book? (Visual Basic 4 / 5 / 6)
- FlexGrid issue and error "Invalid Row value".... (Visual Basic 4 / 5 / 6)
- VB6 Runtime error 7 Out of memory (Visual Basic 4 / 5 / 6)
- Runtime Error (Windows NT / 2000 / XP)
- runtime error#58 (Visual Basic 4 / 5 / 6)
- Visual Runtime Error, Sound Problem, Disabled Norton and more! (Windows NT / 2000 / XP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB to Access connection!
- Next Thread: form shape drawing (arc)
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





