how can I create a pop-up message whenever a workbook is opened?

T

twiftshoeblade

I would like to make a message appear in the form of a pop-up, like an input
or error message, whenever a workbook is opened.
 
B

Bob Umlas, Excel MVP

Right-click the excel LOGO (near the file menu), select View Code, enter this:
Private Sub Workbook_Open()
Msgbox "Hello, World!"
End Sub
Bob Umlas
 
M

Mike H

Hi,

Alt+F11 to open VB editor. Double click 'This Workbook' and paste this in on
the right

Private Sub Workbook_Open()
response = MsgBox("Hello World", vbOKOnly, "My Welcome message")
End Sub

Mike
 
T

twiftshoeblade

Thanks to both Mike H and Bob Umlas... exactly the result I was seeking.
My target audience, however, is likely to disable macros upon opening the
workbook... anyway to disable that warning?
 
J

Jim Thomlinson

There are t ways around it. One is to have your users set their macro
security to low. The down side is that if a workbook contains a virus then
they will open it without warning and get infected. A better option is to
digitally sign your work. That makes your work into a trusted source and the
book can open without need for the macro security alert... Check out this
link...

http://office.microsoft.com/en-us/help/HP052495551033.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top