activating workbooks

J

Jase

Hi All

I have two workbooks with various stuff in the
workbook.activate procedures, now the problem is that if
I have both workbooks open and get the macro to close the
initial workbook the next workbook that is defaulted to
does not run any code in the workbook.activate procedure
or in the (windowactivate in sheetactivate).

Does anyone know how to force these to run. It seems to
work if I just click to close tab on the window but
something different must happen when I run macros as it
doesn't perform in exactly the same way.

Thanks heaps
Jase
 
T

Tom Ogilvy

run the code explicitly in the macro that closes the workbook.

You will probably have to make the procedure Public. I assume it is in the
ThisWorkbook module, so perhaps you could put a procedure in that same
workbook that runs it and then call that procedure from the other workbook
using application.run
 

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