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: 11
Default A COM Add In must handle WorkbookOpen event

In an already working well VB6 written COM addin, in order to obtain that my
COM Add-in intercept WorkbookOpen event I added these lines to the
Connect.dsr code:

***
Dim oMyApp As New ClassXlApp
....
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal
ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom()
As Variant)
On Error Resume Next

Set oXl = Application
Set oMyApp.App = Application
....
***

Instead ClassXlApp contains:

***
Public WithEvents App As Excel.Application
Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook)
Dim sExt As String

On Error GoTo Linea12
MsgBox "ClassXlApp - You open a sheet!!!"
Linea12:
On Error GoTo 0
End Sub
***

but no message box appear.
What I forget to add to my code ?
TIA,
Maurizio

================================================== =======
BELLANTONE MAURIZIO - Teacher, IT Consultant, Programmer
SPINETTA MARENGO (AL) - ITALY
---------------------------------------------------------
E-mail: bellantoneCHIOCCIOLAlibero.it
================================================== =======


 
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
axWebBrowser1_DocumentComplete event handle [email protected][_2_] Excel Programming 1 May 12th 06 01:33 PM
WorkbookOpen Event JJ Excel Programming 2 May 11th 05 08:20 AM
how to handle 'sheetchange' event on 'add-in' Takoyaki Excel Programming 2 December 19th 04 04:50 AM
= How to setup vars when a workbookopen event is launched? hcova[_2_] Excel Programming 1 October 21st 04 07:20 PM
WorkbookOpen event unpredictable JT[_5_] Excel Programming 0 September 21st 04 12:47 PM


All times are GMT +1. The time now is 04:40 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"