ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto_Open vs. macro (https://www.excelbanter.com/excel-programming/277712-re-auto_open-vs-macro.html)

John Wilson

Auto_Open vs. macro
 
Jim,

The Auto_Open won't run when a workbook is opened via code.
If you place your code in the Workbook_Open Event, that will
fire whenever the workbook opens either manually or via code.

You can "run" your Auto_Open macro with the following:
ActiveWorkbook.RunAutoMacros xlAutoOpen

Either way thjough, I believe the Workbook_Open event or calling
the Auto_Open will occur before the paste operation (which won't
do you any good).

A better choice would be to open the second workbook and manipulate
it via the coding in the first workbook (after the paste operation).

John

Jim Melchers wrote:

I am trying to have a macro copy data from 1 worksheet and
paste it into another and then want to automatically
execute a macro in the second which formats, prints, and
closes. Auto_Open doesn't seem to run after the paste
completes. The path to the second file is stored in a
cell in the first, can I use that somehow to establish a
reference to the macro in the second? Any other
suggestions?




All times are GMT +1. The time now is 11:32 AM.

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