View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
lesco_quartz lesco_quartz is offline
external usenet poster
 
Posts: 1
Default How to re-enable events after a VB error in Excel?


Hi - I had the same problem. Resetting after an error left the
SheetSelectionChange event handling I implemented in an Add In (see
'Application Events' (http://www.cpearson.com/excel/AppEvent.aspx)) not
working.

The work around was to relaunch Excel. Here's how I fixed it ...



In my Add in ThisWorkbook code I have:

Private XLApp As CExcelEvents

Public Sub Workbook_Open()
Set XLApp = New CExcelEvents
End Sub


I found that if you run this Workbook_Open sub after an error the event
triggering works again. In my vb app I added a menu item that called it
so the user can fix it.

Private Sub ResetEvents()
ThisWorkbook.Workbook_Open
End Sub


Hope this helps.


--
lesco_quartz
------------------------------------------------------------------------
lesco_quartz's Profile: http://www.thecodecage.com/forumz/me...hp?userid=1198
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=148822

Microsoft Office Help