ItIsHardToProgram
Technical User
Hello all!, I am getting the following error:
execution error 50290, Evaluate object method failed.
when running the following code:
The error occurs on the bold line.
The variable "r" holds nothing.
Here are the declarations:
The code runs fine for a while, but at some point it hits something that gives the error mentioned above. Am I doing this wrong? By the way, that part of the code was provided by a tek-tip M.V.P.
Thanks, don't hesitate to ask for more.
"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
execution error 50290, Evaluate object method failed.
when running the following code:
Code:
Do
For Each ws In Sheets(Array("JfSommaire", "MaSommaire", "MartinSommaire", "BrunoSommaire", "JimSommaire", "NancySommaire", "GuillaumeSommaire"))
[bold]For Each r In ws.Range(ws.[A4], ws.[A4].End(xlDown))[/bold]
If ws.Cells(r.Row, 1) = rst.Fields("IDProjet") Then
ws.Cells(r.Row, 9).Value = rst.Fields("Honoraire utilisé")
End If
Next
Next
rst.MoveNext
Loop Until rst.EOF
The error occurs on the bold line.
The variable "r" holds nothing.
Here are the declarations:
Code:
Dim appExcel As Excel.Application
Dim wbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim ws As Worksheet, r As Range
Dim rst As Recordset
The code runs fine for a while, but at some point it hits something that gives the error mentioned above. Am I doing this wrong? By the way, that part of the code was provided by a tek-tip M.V.P.
Thanks, don't hesitate to ask for more.
"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.