View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Sergiy Sergiy is offline
external usenet poster
 
Posts: 16
Default How to run macro from Add-In when Excel opened workbook?

Dear Dave,

What is the difference between Option 1 ant Option 2 and what technique
is preferable to use?


Option 1
Public WithEvents App As Application
Private Sub Workbook_Open()
Set App = Application
End Sub


Option 2
Public WithEvents App As Application
Dim AppClass As New EventClass

Private Sub Workbook_Open()
Set AppClass.App = Application
End Sub