ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto-run macro after a save-as event (https://www.excelbanter.com/excel-programming/299843-auto-run-macro-after-save-event.html)

Selma Li

Auto-run macro after a save-as event
 
Hi,

I am trying to auto run a macro after I save a workbook. I'm picking u
where someone else is left off so I'm having some trouble following
I'll describe the situation and if you have a better sugguest, pleas
let me know. All help is appreciated!

There is an existing VB project that does a certain action. It wil
write data to an Excel spreadsheet and save it as a .xls. What I wan
to do is do some post-saving actions with a macro that I have alread
written in VBA.

I know that there's a auto_open that automatically open macro's upo
opening of a file. Is there any auto_?? that could detect the savin
of a file and run the macro specified?

Since I already developed the macro in VBA and it uses a lot of cel
references to the Excel spreadsheet, I want to link the VB applicatio
with excel. I want to have a template Excel file whch already contain
the VBA macro, have the VB application write to the template file, sav
the file as something else and run the VBA macro contained.

Or is it better to have the module imported to the excel spreadshee
automatically and run that after the save command in the VB script?

Thank you very very much

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Auto-run macro after a save-as event
 
Hi
look at the workbook event BeforeSave for this

--
Regards
Frank Kabel
Frankfurt, Germany


Hi,

I am trying to auto run a macro after I save a workbook. I'm picking
up where someone else is left off so I'm having some trouble
following. I'll describe the situation and if you have a better
sugguest, please let me know. All help is appreciated!

There is an existing VB project that does a certain action. It will
write data to an Excel spreadsheet and save it as a .xls. What I want
to do is do some post-saving actions with a macro that I have already
written in VBA.

I know that there's a auto_open that automatically open macro's upon
opening of a file. Is there any auto_?? that could detect the saving
of a file and run the macro specified?

Since I already developed the macro in VBA and it uses a lot of cell
references to the Excel spreadsheet, I want to link the VB

application
with excel. I want to have a template Excel file whch already

contains
the VBA macro, have the VB application write to the template file,
save the file as something else and run the VBA macro contained.

Or is it better to have the module imported to the excel spreadsheet
automatically and run that after the save command in the VB script?

Thank you very very much!


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 11:14 PM.

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