View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
R Avery R Avery is offline
external usenet poster
 
Posts: 220
Default Application level event handler broken in 2003SP1 ?

I think you have to set gThisApp = New clsApplication first. I believe
that is the object it is referring to.

Alex T wrote:

Folks

I have a pretty standard class I use to trap application events

-----------------------------------------------------------------
Option Explicit
Public WithEvents myApp As Excel.Application

Private Sub myApp_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean)

' - Traps the close event

' DO STUFF

End Sub
-----------------------------------------------------------------

Which I initialize using this code snippet

-----------------------------------------------------------------
Public gThisApp As clsApplication
Set gThisApp.myApp = Excel.Application
-----------------------------------------------------------------

Resulting in the following error


Object variable or With block variable not set <<<



I'm pretty sure this was working just fine before applying 2003SP1...

Am I missing something obvious ? Any pointer ?

Thanks & regards

--AlexT