Auto_Open() macro in excel97

This is a discussion about Auto_Open() macro in excel97 in the Windows Software category; 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.

Windows Software 5498 This topic was started by ,


data/avatar/default/avatar30.webp

556 Posts
Location -
Joined 2003-03-28
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.

Participate in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.

Responses to this topic


data/avatar/default/avatar30.webp

556 Posts
Location -
Joined 2003-03-28
OP
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

data/avatar/default/avatar30.webp

556 Posts
Location -
Joined 2003-03-28
OP
Nevermind... I finally got auto_open() to work. Not sure why though.