View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Claud Balls Claud Balls is offline
external usenet poster
 
Posts: 72
Default ThisWorkbook.Path not updating

Have you tried compiling the macro after it goes screwy? The code below
might be useful if the path name just needs some time to update, but it
would check if the file exists, and if it doesn't it would wait a
second, and look again.
for i = 1 to 10
MyFile = Dir(pathA)
If MyFile < "" Then
Exit for
else
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
end if
next

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!