ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto_Open Frustration (https://www.excelbanter.com/excel-programming/355378-auto_open-frustration.html)

CG[_3_]

Auto_Open Frustration
 
I have a macro I want to run every time I open *any* Excel file. It
searches across all worksheets and replaces NOW() with a constant. I
saved it in my personal.xls file as Auto_Open, but when I open any file
nothing happens. (this is where I get confused)

If I then manually open my personal.xls file the macro instantly runs
on my currently open file.

How can I make it run on any file I open in my Excel without manually
opening personal.xls...


Dave Peterson

Auto_Open Frustration
 
You'll need to use an application event that's looking to see when you open
files.

See Chip Pearson's site:
http://www.cpearson.com/excel/AppEvent.htm

But this kind of thing would scare me. You may open a workbook that you don't
want =now() replaced.

I think I would keep it a run on-demand macro.



CG wrote:

I have a macro I want to run every time I open *any* Excel file. It
searches across all worksheets and replaces NOW() with a constant. I
saved it in my personal.xls file as Auto_Open, but when I open any file
nothing happens. (this is where I get confused)

If I then manually open my personal.xls file the macro instantly runs
on my currently open file.

How can I make it run on any file I open in my Excel without manually
opening personal.xls...


--

Dave Peterson


All times are GMT +1. The time now is 01:56 AM.

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