How do I get a macro to run automatically


Posted by Donna on June 03, 2000 8:54 PM

I have been using VBA in MS Word and want to know how to get a message box macro to run when File New is clicked for a template. I want the equivalent of FileNew in Word.

Posted by Donna on June 06, 0100 9:58 AM

Thanks Celia but that isn't exactly what I want. I want a message box to display when a new template is opened. The message box just gives them some information about the template and they only have to click ok, then the message box will go away.


Posted by Donna on June 04, 0100 1:59 PM


Posted by Celia on June 06, 0100 4:03 PM

Donna
Put the following in the ThisWorkbook module :-

Private Sub Workbook_Open()
MsgBox "Put your message here"
End Sub

Celia

Posted by Celia on June 04, 0100 4:29 PM


Donna
I'm not sure this is what you want, but the following will open a new workbook and display the "Save As" dialog box :-

Workbooks.Add
Application.Dialogs(xlDialogSaveAs).Show

Celia

Posted by Donnq on June 06, 0100 7:13 PM


Thanks Celia. That was the answer to my question. How long have you been doing this?



Posted by Celia on June 06, 0100 9:18 PM


Donna
I started trying to learn VBA about 6 months ago.
Celia