ViolentGreen 0 Posted April 28, 2003 I am trying to create a macro to run whenever a particular workbook is opened. I have done some searches and it appears that I just create a macro called Auto_Open(). To test this I used the code Sub Auto_Open() MsgBox ("test") End Sub This did not work. Can anyone tell me how to do this? Visual basic continues to baffle me. Share this post Link to post
ViolentGreen 0 Posted April 28, 2003 Quote: Quote: I am trying to create a macro to run whenever a particular workbook is opened. I have done some searches and it appears that I just create a macro called Auto_Open(). To test this I used the code Sub Auto_Open() MsgBox ("test") End Sub This did not work. Can anyone tell me how to do this? Visual basic continues to baffle me. All or most Microsoft "compound" OLE document types have an autoexec.macro... that's the one to look @! (That's also the one that macro virii infect as well) * APK P.S.=> & like autoexec.bat & your startup groups etc., you can bypass opening & running it by holding down the shift key as it opens... some extra "FYI"... apk I don't know if I am understanding you or not. Are you saying to use Sub AutoExec() MsgBox ("test") End Sub or Sub AutoExec.macro() MsgBox ("test") End Sub ? Neither of these seem to work. The AutoExec.macro doesn't like the '.' Thanks Share this post Link to post
ViolentGreen 0 Posted April 28, 2003 Nevermind... I finally got auto_open() to work. Not sure why though. Share this post Link to post