Dueling programs

G

Guest

I am using Office 2003 on Windows XP.

Is there a way when opening a second file programmatically, to allow the
second file's ON_OPEN event code to finish before performing other tasks with
it from the first file?

e.g. User is in File1 and triggers File2 to open. File1 waits for File2's
ON_OPEN code to finish, then File1's code resumes...

I tried pausing my code in the calling file, but I still get "Application
Defined Error".

Any suggestions?
 
D

Dave Peterson

That's the way it's supposed to work. Excel isn't multithreaded (if I used that
correctly).

It starts something (like the workbook_open event, it'll finish that before
returning to the original code).

Are you opening the second workbook in the same instance of excel? (That could
make a difference, since there would be two copies of excel running.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top