View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Workbook_Open Problem ... Worksheets not loaded yet!?

The ontime schedule macro can't execute until the workbook is closed and the
calling code stops. then it fires - reopening the workbook so it can run.

In the code that peforms the functions you describe, use

application.EnableEvents = False
' open, process, close the workbook
Application.EnableEvents = True

this will keep the workbook_open event from firing.

--
Regards,
Tom Ogilvy

"Joe HM" wrote in message
oups.com...
Helllo ... I actually jumped the gun a little early. It works great
most of the time but there is a problem when I do the following:

I have another sheet with a macro that opens the one with the _Open().
It inserts some cells and does stuff and then it does a .SaveAs and
.Close. On the file. For some reason, the file I just saved as opens
automatically if I keep the OnTime in the _Open(). Any idea what that
could be???