ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2000: How to execute code automatically? (https://www.excelbanter.com/excel-programming/308244-excel-2000-how-execute-code-automatically.html)

Mike Mertes

Excel 2000: How to execute code automatically?
 
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



MD

Excel 2000: How to execute code automatically?
 

sub auto_open()
'place your code here
msgbox("hello")
End Sub

Regards



"Mike Mertes" a écrit dans le message de
...
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





MD

Excel 2000: How to execute code automatically?
 


Cancel that other reply...

Sorry


"Mike Mertes" a écrit dans le message de
...
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





Tom Ogilvy

Excel 2000: How to execute code automatically?
 
Look at Chip Pearson's page on events:

http://www.cpearson.com/excel/events.htm

You would want to use the Workbook_Open event which must be placed in the
ThisWorkbook module.

--
Regards,
Tom Ogilvy


"Mike Mertes" wrote in message
...
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





Mike Mertes

Excel 2000: How to execute code automatically?
 
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

"MD" wrote in message
...

sub auto_open()
'place your code here
msgbox("hello")
End Sub

Regards



"Mike Mertes" a écrit dans le message de
...
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







Tom Ogilvy

Excel 2000: How to execute code automatically?
 
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.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Look at Chip Pearson's page on events:

http://www.cpearson.com/excel/events.htm

You would want to use the Workbook_Open event which must be placed in the
ThisWorkbook module.

--
Regards,
Tom Ogilvy


"Mike Mertes" wrote in message
...
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







MD

Excel 2000: How to execute code automatically?
 
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


"Mike Mertes" a écrit dans le message de
...
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

"MD" wrote in message
...

sub auto_open()
'place your code here
msgbox("hello")
End Sub

Regards



"Mike Mertes" a écrit dans le message de
...
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









Witek

Excel 2000: How to execute code automatically?
 

your,
"stupid quaction" save my ass
tx peopl

--
Wite
-----------------------------------------------------------------------
Witek's Profile: http://www.excelforum.com/member.php...fo&userid=1460
View this thread: http://www.excelforum.com/showthread.php?threadid=25114



All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com