wolf.stalker
10-30-2009, 08:33 PM
To start, thanks your help! :hi:
Let me start by saying that I wrote this code months ago (4-6) and the only thing that I know has changed was that two weeks ago we upgrade from office 2003 to office 2007 (which I am also fixing other issues thanks to this upgrade) but this one has me stumped. :banghead:
I can't put all the code here, but let me show you what I can and see if you can help.
LoadDate ' var passed by val
(2) If LoadDate > #8/29/2010# Then
(3) MsgBox ("This date is out of range")
(4) Exit Sub
(5) End If
now, here is the wierd part. if the date is before 11/01/2009, this all works perfectly. if the date is 11-1, 11-2, 11-3, 11-4, 11-5, 11-6, 11-7, 11-8, 11-9 then i get the error message on line (6) <Object variable or With block variable not set>. as far as i can tell (and i tested random dates beyond 11/10/2009 it works fine :-\ This process gets run daily and has done so w/o error from 8/31/2009 to present.
The sheet it's looking to find the date on line (6), all the dates are formated the same as just plain text values, not date or number.
Why in the hell would it bug here between 11-1 and 11-9 ? :dunno
(6) If Worksheets(3).Range("B" & iLcv) = "UNL" Then
(7) Cells.Find(What:=LoadDate, After:=Range("A1"), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
Thanks for any help you can provide.
Let me start by saying that I wrote this code months ago (4-6) and the only thing that I know has changed was that two weeks ago we upgrade from office 2003 to office 2007 (which I am also fixing other issues thanks to this upgrade) but this one has me stumped. :banghead:
I can't put all the code here, but let me show you what I can and see if you can help.
LoadDate ' var passed by val
(2) If LoadDate > #8/29/2010# Then
(3) MsgBox ("This date is out of range")
(4) Exit Sub
(5) End If
now, here is the wierd part. if the date is before 11/01/2009, this all works perfectly. if the date is 11-1, 11-2, 11-3, 11-4, 11-5, 11-6, 11-7, 11-8, 11-9 then i get the error message on line (6) <Object variable or With block variable not set>. as far as i can tell (and i tested random dates beyond 11/10/2009 it works fine :-\ This process gets run daily and has done so w/o error from 8/31/2009 to present.
The sheet it's looking to find the date on line (6), all the dates are formated the same as just plain text values, not date or number.
Why in the hell would it bug here between 11-1 and 11-9 ? :dunno
(6) If Worksheets(3).Range("B" & iLcv) = "UNL" Then
(7) Cells.Find(What:=LoadDate, After:=Range("A1"), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
Thanks for any help you can provide.