View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default module won't quit as expected

Disregard the multiple post message.


"JLGWhiz" wrote in message
...
It is not necessary to post multiple times. See your original post.


"Sabosis" wrote in message
...
Hello-

I have the following code in a module so that on holidays, when there
is no data in the file, the code will see "b2" as a blank and kill the
code and exit excel. This works in other macrosI have, but this
particular macro will throw up an error message. Whether I hit End or
Debug, Excel will then shut down as planned. If I manually step
through the code, it works fine. Is there some sort of delay I need to
write into the code so that it has more time to trigger this event?

Thanks-

Scott

If Range("b2").Value = "" Then
Application.DisplayAlerts = False
Application.Quit
End If