View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Arvi Laanemets Arvi Laanemets is offline
external usenet poster
 
Posts: 510
Default Is there an "OnOpen" event for Excel

Hi

There is an Open event for Excel workbook. Open VBA editor, and in VBA
Project window, right-click on ThisWorkbook object, and select View Code.
Then select Workbook in left dropdown at top of code window - Open event is
the one automatically created after that.


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



"Jurrasicway" wrote in message
...
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.