Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Workbook hangs Excel

Status
Not open for further replies.

bultimatem

Programmer
Jun 9, 2003
13
US
When I try to open another workbook using VBA (it's not toooo large at 245K) Excel hangs (CPU goes to 100%) and I have to use the task manager to close excel and start over. When I step through the procedure doing the openning with the debugger (which then steps through all of the open events in the workbook I'm trying to open), everything works just the way I want it to. I'm stumped. The fact that the step-through works leads me to believe that it's not syntax. The workbook I'm trying to open has many Worksheet_Open events, including the installation of an add-in and the building of a toolbar. Again, I would suspect those, except for the fact that it runs fine on step-through and when simply opening the file from a windows browser.

If anyone has any ideas, I'm all ears!

Thanks in advance,

Bryan
 
In a workbook with a lot of code, it could be almost anything. Looks like you are stuck with good, old-fashioned debugging. I'd try disabling one Sub at a time (starting with the most unusual ones like the add-in) to isolate where the offending code is.

My other thought was to ask if the workbook starts any processes outside itself. If so it might not be waiting for those processes to execute (while break mode gives them time to do so).

Good luck!

VBAjedi [swords]
 
I've found that this is actually hanging, not in the open statement but in the first workbook's deactivate activities. Again, it runs through the debugger fine. I've gone through the deactivation routine and put a breakpoint at the very last End Sub before it returns to the code and it's fine, it's just when I remove the breakpoint. The very same code for opening (and the deactivation) has been used in another part of the program and has been fine so again, I have no idea.

Bryan Marble
IEWS
BAE Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top