MrExcel Publishing
Your One Stop for Excel Tips & Solutions

2 of the same Excel file open at once

Posted by Steve on May 03, 2000 11:44 AM

My application uses both custom toolbars and menu bars.
At some point someone may want to open more than one file
at a time. Both files open and operate fine until you
close one of the files. Excel gives an error message
of "Application-defined or Object-define error". It
deactives the first file but before the Workbook_Activate
procedure is run this error occurs.
Does anyone know what this error is telling me? and how
can I get around this error?



Posted by Ivan Moala on May 03, 2000 5:41 PM

It copuld be that youare not setting your commandbars
What is your code for activating and deactivating the command bars ??
Are you creating them using workbook open event and
then deleteing them on the workbook close routine ??.


Posted by Steve on May 09, 2000 12:20 PM


Thanks for your response. I've been working on the
problem and still cannot figure out.

I put the code for the commandbars everywhere (open,
close, activate, deactivate). It looks like if I have
any code in the Workbook_Activate sub, I get that
error. I even tried to have the Workbook_Activate
sub blank and I still get that error. But if I open
a different workbook, I can have code in the
Workbook_Activate sub. I have no clue why this is
happening. If you have any idea, let me know.

Thanks again,


Posted by Ivan Moala on May 15, 2000 2:19 AM

Is it poss to email me the workbook
Doesn't have to be the whole Wb.