Results 1 to 3 of 3

Thread: activate and deactivate events don't work?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    activate and deactivate events don't work?

    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

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: activate and deactivate events don't work?

    Opening the Spreadsheet? or the Workbook?

    to trigger code when you Open the Workbook:

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



    VB Code:
    1. Private Sub Workbook_BeforeClose(Cancel As Boolean)
    2.     'Code here
    3. End Sub
    4.  
    5. Private Sub Workbook_Open()
    6.     'Run Code Here
    7. End Sub
    8.  
    9. Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    10.     'Code here...
    11. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    Re: activate and deactivate events don't work?

    Thank you Static.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width