#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default AutoRun

Hi,

I have a worksheet that loads automatically (Xlstart folder), but hidden.

There is a few macros in it, but what I want to acheive is when I open a
file I want a macro to execute, but I don't know where to put it.

It doesn't work on the workbook_open sub, since this one starts only when
the initial file loads.

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default AutoRun

If you want code to run when *any* workbook is opened, you need to use
application-level events, specifically the App_WorkbookOpen event (for
opening existing workbooks) and/or the App_NewWorkbook event (when a new
workbook is created). See http://www.cpearson.com/excel/AppEvent.aspx for
details and example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"Usen" wrote in message
...
Hi,

I have a worksheet that loads automatically (Xlstart folder), but hidden.

There is a few macros in it, but what I want to acheive is when I open a
file I want a macro to execute, but I don't know where to put it.

It doesn't work on the workbook_open sub, since this one starts only when
the initial file loads.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default AutoRun

Thanks, it works great.


"Chip Pearson" a écrit dans le message de news:
...
If you want code to run when *any* workbook is opened, you need to use
application-level events, specifically the App_WorkbookOpen event (for
opening existing workbooks) and/or the App_NewWorkbook event (when a new
workbook is created). See
http://www.cpearson.com/excel/AppEvent.aspx for
details and example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"Usen" wrote in message
...
Hi,

I have a worksheet that loads automatically (Xlstart folder), but hidden.

There is a few macros in it, but what I want to acheive is when I open a
file I want a macro to execute, but I don't know where to put it.

It doesn't work on the workbook_open sub, since this one starts only when
the initial file loads.

Thanks.




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
Autorun EmilH Excel Programming 6 June 5th 07 10:30 AM
autorun a macro Smudge Excel Programming 4 August 11th 06 01:21 PM
Autorun.inf Pam Excel Programming 2 October 17th 05 06:56 PM
Autorun a macro Paul Wisken Excel Programming 6 September 7th 05 09:02 AM
Autorun Add-In A.M Excel Programming 2 September 21st 04 04:19 PM


All times are GMT +1. The time now is 07:18 PM.

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"