View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
EmilH EmilH is offline
external usenet poster
 
Posts: 5
Default Application-defined or object defined error

Pease take a look at this simple code:

--------------------

Sub Workbook_Open()
CheckRows
End Sub

Sub CheckRows()
Dim temp As Long
temp = 1

Do Until Sheet1.Cells(temp, 2).Value DateTime.Date 'this
line returns me the error in the end.

If Sheet1.Cells(temp, 2).Value = DateTime.Date Then
Sheet1.Cells(temp, 2).Interior.Color = RGB(255, 0, 0)
End If

temp = temp + 1

Loop
End Sub

--------------------

It does what I want but in the end returns 'Application-defined or
object-defined error'

What could cause this?

Thanks.
EmilH