View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Supressing MsgBox poop-ups from VBA

You can set your username in Excel to something unique and then use an
If statement to check for it before displaying the message box.
Something like
If Application.Username < "something_unique" Then MsgBox("Whatever")

You can change you username by going to Tools--Options and selecting
the General tab. Please not that there are other ways of doing this
as well.
Hi All

I have added a MsgBox message to my system on Workbook_Open to display
a message if the user has opened the system in read-only. The message
just warns them that they cannot make changes. This works fine.

I have now written a report generator which opens the main system in
read-only mode to collect the data. The problem is that my report
generator also gets the read-only message and therefore waits for me
to click "OK".

How can I supress this message from my report generator code yet still
have it pop up for a normal user?

Application.DisplayAlerts = False does not solve the problem as my
message is a MsgBox and not an Excel alert.

Any ideas? Thanks in advance,
Chrisso