Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 26
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 26
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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






  #7   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 26
Default 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








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you execute single line of code? honestlylion Excel Discussion (Misc queries) 2 February 24th 06 03:35 PM
Automatically execute a CTRL-ALT-F9 when I open a workbook Antonio Duarte Excel Discussion (Misc queries) 1 June 15th 05 02:48 PM
Execute Macro automatically after hyperlink Bill Elerding Excel Discussion (Misc queries) 13 May 5th 05 01:01 AM
Code-signing certificate problems in Excel 2000 with Windows 2000 Aaron Queenan Excel Programming 0 May 6th 04 11:35 AM
execute code for all 12 months Herb Buist Excel Programming 0 July 19th 03 03:43 PM


All times are GMT +1. The time now is 08:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"