ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Userforms and Macros (https://www.excelbanter.com/excel-discussion-misc-queries/77469-userforms-macros.html)

cinvic

Userforms and Macros
 
How do I get a message box to pop up when a file is opened?

Sub WorkBook_Activate()
MsgBox "Any physician reporting ...."
End Sub

This code gets message box to the worksheet only if I hit run from the VB
editor. I would like to warn the worksheet user as soon as they open the file.

Thanks,
Cinvic

Ardus Petus

Userforms and Macros
 
You must place your code in ThisWorkbook's code, not in a Module

HTH
--
AP

"cinvic" a écrit dans le message de
...
How do I get a message box to pop up when a file is opened?

Sub WorkBook_Activate()
MsgBox "Any physician reporting ...."
End Sub

This code gets message box to the worksheet only if I hit run from the VB
editor. I would like to warn the worksheet user as soon as they open the

file.

Thanks,
Cinvic




cinvic

Userforms and Macros
 
Thanks! It works.

"Ardus Petus" wrote:

You must place your code in ThisWorkbook's code, not in a Module

HTH
--
AP

"cinvic" a écrit dans le message de
...
How do I get a message box to pop up when a file is opened?

Sub WorkBook_Activate()
MsgBox "Any physician reporting ...."
End Sub

This code gets message box to the worksheet only if I hit run from the VB
editor. I would like to warn the worksheet user as soon as they open the

file.

Thanks,
Cinvic






All times are GMT +1. The time now is 12:07 AM.

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