LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default class events stop firing with ADO 2.8

Excel add-in has been working for 2 years using ado 2.7; it fails on ado 2.8.
Here's stripped down version that displays message boxes for all events used.
This test works on ado 2.7. It has a reference to "Microsoft ADO Ext.2.7. for
DDL and Security". I load this Add-in programmatically. All events fire as
expected.

Now when i use this same Add-in on a system with ADO 2.8 {in my test case XP
SP2} it begins ok. The FIRST, SECOND and THIRD EVENT occur correctly then the
events no longer fire. For example the right-click does not occur, etc. If i
change the ado reference to "Microsoft ADO Ext.2.8. for DDL and Security". It
works fine... events continue to fire.

I can cheat and have two Add-ins; one with ado 2.7 and one with 2.8. There
has to be a better way. Can you input?



--------------------------------------------------------------------------------

'***EXCEL WORKBOOK OF ADD-IN***
Option Explicit
Dim AppClass As New AppEventClass

Public Sub Workbook_Open()
MsgBox ("Public Sub Workbook_Open() FIRST EVENT")
Set AppClass.App = Application
End Sub

--------------------------------------------------------------------------------

'***AppEventClass - an Excel VBA class module***
Option Explicit
Public WithEvents App As Application

Private Sub app_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As
Range, Cancel As Boolean)
MsgBox ("Private Sub app_SheetBeforeRightClick RIGHT CLICK")
End Sub

Private Sub App_SheetActivate(ByVal Sh As Object)
MsgBox ("Private Sub App_SheetActivate(ByVal Sh As Object)")
End Sub

Private Sub App_WorkbookAddinUninstall(ByVal Wb As Workbook)
On Error Resume Next
MsgBox ("Private Sub App_WorkbookAddinUninstall(ByVal Wb As Workbook)")
Call removeMe(Wb.Name)
End Sub

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As
Boolean, Cancel As Boolean)
On Error Resume Next
MsgBox ("Private Sub App_WorkbookBeforeSave")
End Sub

Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
MsgBox ("Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook) NAME =
" & Wb.Name)
If Wb.Name = Workbooks.Item(1).Name Then Call removeMe(Wb.Name)
End Sub

Private Sub removeMe(removing As String)
MsgBox ("Private Sub removeMe() " & removing)
End Sub

Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
MsgBox ("Private Sub App_WorkbookOpen(ByVal Wb As Workbook) " & Wb.Name
& " THIRD EVENT")
End Sub

Private Sub Class_Initialize()
MsgBox ("Private Sub Class_Initialize() SECOND EVENT")
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent BeforeCloseEvent firing more than once. Daffo Excel Discussion (Misc queries) 3 October 16th 06 02:32 PM
Events, Class, Time Editing Dave Excel Programming 1 October 4th 04 11:06 PM
Events firing willy nilly Darren Hill[_2_] Excel Programming 4 January 23rd 04 10:00 PM
RaiseEvent from a class contained in a 2nd class collection? Andrew[_16_] Excel Programming 2 January 6th 04 04:22 PM
What events can be captured in a Class Module? Tom Ogilvy Excel Programming 4 September 8th 03 05:41 AM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"