Excel 2000: How to execute code automatically?

M

Mike Mertes

Is there a way to have Excel automatically execute code when it is opened?

I hope this sounds like a terribly stupid question, because It seems like it
should have an easy answer.

The reason I ask is because I want to connect the Excel application to an
application object declared in a class module in Personals.xls, such that I
can write code to evaluate the name of every workbook opened in Excel with a
WorkbookOpen event, including the very firstly opened workbook and without
depending on any specific workbook's auto_open macros.

TIA, MVPs.
I really appreciate any help you can offer. :)

-Mike Mertes
Airtron, Tampa Bay
 
M

Mike Mertes

Oh my, for such a smart guy I can be pretty stupid sometimes. :)

It didn't even occur to me that I might want to try an auto_open event in
personals.xls

Anyway, mission accomplished. Sincere thanks again, MD.

-Mike
 
T

Tom Ogilvy

Guess I didn't read far enough:

So use the Workbook_Open event of personal.xls.

I haven't tested it with the high security settings of xl2002 and 2003, but
in xl2000 and earlier, personal.xls has macros enabled without prompt. Your
class in personal.xls would be useless if personal.xls were not opened
(anyway).

workbook_open is the only event that is triggered automatically when macros
are not disabled. So I believe you would have to depend a workbook_open
event for some workbook.
 
M

MD

My eye cought your first 2 lines.... I reposted asap to cancel my reply
after reading the rest. I'm glad you mission is now accomplish "smart guy"

Sincere sorry to anyone who was troubled

MD
 

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