AutoExec module

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

AutoExec module

Post by agibsonsw »

Hello - Excel 2003.
There are two modules named AutoExec and AutoMacro in a Excel addin file.
Do the procedures in these run automatically, or have they just chosen odd names to use?
Thanks, Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
HansV
Administrator
Posts: 78530
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: AutoExec module

Post by HansV »

Code that should be run automatically is usually called from the Workbook_Open event procedure in the ThisWorkbook module. Another option is to create a macro in a standard module named Auto_Open.

AutoExec and AutoMacro have no special meaning in Excel, they won't run automatically. But they might be called from Workbook_Open or from Auto_Open.
Best wishes,
Hans

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: AutoExec module

Post by agibsonsw »

Hi. Thanks.
Yes there is a macro called Auto_open. There are also procedures called FileOpen(), FileSave() in standard
modules. I assume these will not run automatically either? Ta, Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
HansV
Administrator
Posts: 78530
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: AutoExec module

Post by HansV »

Those won't be run automatically either. If it had been in Word, a macro named FileOpen would automatically be run if the user selects File | Open, presses Ctrl+O or clicks the Open button on the Standard toolbar, but not in Excel.
Best wishes,
Hans

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: AutoExec module

Post by agibsonsw »

Aha! Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.