ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Show msgbox only when.... (https://www.excelbanter.com/excel-programming/272880-show-msgbox-only-when.html)

Tod

Show msgbox only when....
 
Is there a way to show a msgbox only if the user opens the
workbook? The workbook is also opened by a script to
update some data. I don't want the msgbox code to run if
the workbook is opened from the script.

tod

Chip Pearson

Show msgbox only when....
 
Tod,

Look at the UserControl property. E.g.,

If Application.UserControl = True Then
MsgBox "Hello, World"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tod" wrote in message
...
Is there a way to show a msgbox only if the user opens the
workbook? The workbook is also opened by a script to
update some data. I don't want the msgbox code to run if
the workbook is opened from the script.

tod




Cesar Zapata[_2_]

Show msgbox only when....
 
Tod,



try

Private Sub Workbook_Open()



MsgBox "HI this message is open"



End Sub



cesar zapata







"Tod" wrote in message
...
Is there a way to show a msgbox only if the user opens the
workbook? The workbook is also opened by a script to
update some data. I don't want the msgbox code to run if
the workbook is opened from the script.

tod




tod

Show msgbox only when....
 
Hey this is great! Perfect for what I need.

thanx

"Chip Pearson" wrote in message ...
Tod,

Look at the UserControl property. E.g.,

If Application.UserControl = True Then
MsgBox "Hello, World"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tod" wrote in message
...
Is there a way to show a msgbox only if the user opens the
workbook? The workbook is also opened by a script to
update some data. I don't want the msgbox code to run if
the workbook is opened from the script.

tod



All times are GMT +1. The time now is 08:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com