PDA

View Full Version : Solved: Run a macro with the opening of a file



jumbel
10-09-2008, 05:21 AM
Is it possible to run the macro as soon as you open he file. I mean, when we doublt click the file to open it, it should run the macro immeadiately after opening the file and then display the data. The macros fills the data in the excel sheet from another master file. I need to do so coz I need to have the updated data in my excel file daily.

Please help!!

CreganTur
10-09-2008, 05:23 AM
Have you looked at the Workbook_Open event? It is a workbook level event and would go in the ThisWorkbook module.

jumbel
10-09-2008, 05:53 AM
Yes found it. Thanks

Also found another way, if you rename your macro auto_open, and type in the code there, it works.

Sub auto_open()

Your code

End sub

lucas
10-09-2008, 07:09 PM
Auto_Open is considered old school. Use the workbook open event as Randy has indicated in anything later than Office 95 I think.

jumbel
10-14-2008, 12:08 AM
Thanks Lucas and Cregan