Morning all,
The code snippet below is the subject of my question.
The line in red gives me a run-time error '424'. Object required.
The file has the necessary 'Microsoft Scripting Runtime' reference checked off.
An earlier (in the code) error catching If..End If, shown below, executed correctly and wrote the stream.WriteLine statement to the error log file.
I have been using this same basic construct for many projects without a problem.
Any help would be much appreciated.
Thanks,
George Teachman
The code snippet below is the subject of my question.
Code:
If r = 7 Then
analyte = "Horizon Depth to Top"
If Cells(r, K) = 6 Then
Err = Err + 1
[COLOR=#ff0000] stream.WriteLine analyte & " is missing in cell " & KOL & r & ", please correct."
[/COLOR] End If
If Cells(r, K) < 0 Or Cells(r, K) > 9999 Then
Err = Err + 1
stream.WriteLine analyte & " is outside range, 0 to 9999, inclusive in cell " & KOL & r & ". Please correct."
End If
End If
The line in red gives me a run-time error '424'. Object required.
The file has the necessary 'Microsoft Scripting Runtime' reference checked off.
An earlier (in the code) error catching If..End If, shown below, executed correctly and wrote the stream.WriteLine statement to the error log file.
Code:
If Range("P2") = "" Then
Err = Err + 1
stream.WriteLine Err & " Missing Date. Please enter date, cell P2."
End If
I have been using this same basic construct for many projects without a problem.
Any help would be much appreciated.
Thanks,
George Teachman