J
Jacques
Hello,
I created a simple VB6 Word add-in.
I have not written a single line of code,
and the program generates a run-time error.
Steps:
1) Created an add-in project.
2) Opened the designer of connect.dsr and set
Application to "Microsoft Word".
3) Added a reference in the VB project to "Microsoft
Word 9.0 Object Library".
4) Changed the Load behavior to "Start Up"
5) Changed the Debugging tab to start program
"c:\program files\..\Winword.exe
6) Set a break point in the
AddinInstance_OnConnection(..) method.
7) Clicked F5 to Start Debugging
The program immediatly generates a run-time error: "Type
Mismatch"
Option Explicit
Public VBInstance As VBIDE.VBE
[...]
Private Sub AddinInstance_OnConnection(
ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode,
ByVal AddInInst As Object,
custom() As Variant)
On Error GoTo error_handler
'save the vb instance
Set VBInstance = Application 'Generates a run-time
'error: "Type mismatch"
'The value of Application is "Microsoft Word"
...
End Sub
Any Ideas?
TIA,
Jacques
I created a simple VB6 Word add-in.
I have not written a single line of code,
and the program generates a run-time error.
Steps:
1) Created an add-in project.
2) Opened the designer of connect.dsr and set
Application to "Microsoft Word".
3) Added a reference in the VB project to "Microsoft
Word 9.0 Object Library".
4) Changed the Load behavior to "Start Up"
5) Changed the Debugging tab to start program
"c:\program files\..\Winword.exe
6) Set a break point in the
AddinInstance_OnConnection(..) method.
7) Clicked F5 to Start Debugging
The program immediatly generates a run-time error: "Type
Mismatch"
Option Explicit
Public VBInstance As VBIDE.VBE
[...]
Private Sub AddinInstance_OnConnection(
ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode,
ByVal AddInInst As Object,
custom() As Variant)
On Error GoTo error_handler
'save the vb instance
Set VBInstance = Application 'Generates a run-time
'error: "Type mismatch"
'The value of Application is "Microsoft Word"
...
End Sub
Any Ideas?
TIA,
Jacques