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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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

thao-nhiAuthor Commented:
added vb code as above, saved as macro-enabled workbook. Nothing happened when opening the file. What am I missing?
Wayne Taylor (webtubbs)Commented:
The code needs to go in the ThisWorkbook module.
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Michael FowlerSolutions ConsultantCommented:
It is also worth noting that macros need to be enabled for this to work
thao-nhiAuthor Commented:
running the code in vb is fine. it does not work when opening the file????
Michael FowlerSolutions ConsultantCommented:
Here is @Wayne's code placed into an example workbook.
Example.xlsm
thao-nhiAuthor Commented:
how to change the title "Microsoft Excel" in the title?
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

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
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.