View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Paul Mathews Paul Mathews is offline
external usenet poster
 
Posts: 84
Default Is there an "OnOpen" event for Excel

Yep, use Workbook_Open. In the VBE Project Browser, find your project, open
the folder, "Microsoft Excel Objects" and double-click on the "ThisWorkbook"
item. Select "Workbook" from the "(General)" drop list, and select "Open"
from the "(Declarations)" drop list. Put your code in the Workbook_Open sub.

"Jurrasicway" wrote:

Hi,
I wish to display a message box when a user opens the spreadsheet. How do I
make my message box code run? I have tried the following but it does not seem
to work:

Sub DisplayMessageBox()
If Sheet("Price Change Request").active = True Then
MsgBox "hello"
End if
End Sub

How do I trigger this sub routine or is there an "OnOpen" event that I can
attach my code to?

Graeme.