#1   Report Post  
Posted to microsoft.public.excel.misc
cinvic
 
Posts: n/a
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.misc
cinvic
 
Posts: n/a
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"