Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do you execute single line of code? | Excel Discussion (Misc queries) | |||
Automatically execute a CTRL-ALT-F9 when I open a workbook | Excel Discussion (Misc queries) | |||
Execute Macro automatically after hyperlink | Excel Discussion (Misc queries) | |||
Code-signing certificate problems in Excel 2000 with Windows 2000 | Excel Programming | |||
execute code for all 12 months | Excel Programming |