PDA

Click to See Complete Forum and Search --> : activate and deactivate events don't work?


waely
Jun 23rd, 2006, 07:42 AM
hi,
I want to run some code upon opening the spreadsheet and upon exiting the application but the Worksheet_Activate and Worksheet_Deactivate never worked. is there a solution or suggestion?

thank you,
waely

Static
Jun 23rd, 2006, 08:06 AM
Opening the Spreadsheet? or the Workbook?

to trigger code when you Open the Workbook:

use the events in the "ThisWorkbook" module...




Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Code here
End Sub

Private Sub Workbook_Open()
'Run Code Here
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'Code here...
End Sub

waely
Jun 23rd, 2006, 08:35 AM
Thank you Static.