Poping up a message box in Excel 2010 onload

I would like to pop up a message box or dialog box in an Excel 2010 file stored on a network so that when a user  opens the file, it will draw their attention to  certain conditions. The message must work also in read-only mode so that anyone will get the message when more than 1 user opens the file.  Thanks
thao-nhiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
Use the Workbook_Open event. Something like this...

Private Sub Workbook_Open()
    MsgBox "Your message here." & vbCrLf & "Use 'vbCrLf' to have multiple lines."
End Sub

Open in new window

0
thao-nhiAuthor Commented:
added vb code as above, saved as macro-enabled workbook. Nothing happened when opening the file. What am I missing?
0
Wayne Taylor (webtubbs)Commented:
The code needs to go in the ThisWorkbook module.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Michael FowlerSolutions ConsultantCommented:
It is also worth noting that macros need to be enabled for this to work
0
thao-nhiAuthor Commented:
running the code in vb is fine. it does not work when opening the file????
0
Michael FowlerSolutions ConsultantCommented:
Here is @Wayne's code placed into an example workbook.
Example.xlsm
0
thao-nhiAuthor Commented:
how to change the title "Microsoft Excel" in the title?
0
Michael FowlerSolutions ConsultantCommented:
The msgbox function has the following format

MsgBox(prompt[, buttons] [, title] [, helpfile, context])
https://msdn.microsoft.com/en-us/library/aa445082(v=vs.60).aspx

So you could have a messagebox with the Information icon, OK button and a title with
MsgBox "Your message here", vbInformation + vbOKOnly, "Message Title"

Open in new window


Here are some more examples
http://analysistabs.com/vba/msgbox-examples-macros/
Example.xlsm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thao-nhiAuthor Commented:
thank you all
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.