S
sgailey
VB6.0 (SP3)
Windows XP
OK, it sounded simple to me at first. I'm trying to use a custom control
in a VBA form. I reduced the control to rule out any other application
errors to a label whose caption changes when clicked. I admit that I
don't have much experience with ActiveX controls, but VB makes it seem so
easy with the "File/NewProject/ActiveX Control": option. I have seem
several problems or Error using this control in VBA:
Error 459 "Object or Class does not support the set of events" or
"Object Not Found" or
"ObjectLibraryinvalid or contains references to object definitions
that could not be found"
I think I'm going crazy, I get the above errors at different times, but
can not see a pattern. I have maintained Binary compatibility with the
control, and have tried moving the OCX to a windows/system or
windows/system32 directory. Sometimes I run a new VBA project and
sometimes the saved project. I have recreated the OCX from scratch, but
have tried to unregistered, delete, compile, and replace the compatible
version of the OCX. I've done this before with ActiveX dll's that I've
created without any problems.
Now I can use this same control in a plan VB form without any
problems. Its seems to be something to do with VBA, either inside an
Office application or from IAPCIntegration inside my own VB app. Any
ideas? Thanks in advanced for any help.
I've included the test control code here:
Option Explicit
Private m_lstate As Long
Private Sub ClickLabel_Click()
If m_lstate = 0 Then
clicklabel.Caption = "Off"
m_lstate = 1
Else
clicklabel.Caption = "On"
m_lstate = 0
End If
End Sub
Private Sub ClickMain_InitProperties()
m_lstate = 0
End Sub
Windows XP
OK, it sounded simple to me at first. I'm trying to use a custom control
in a VBA form. I reduced the control to rule out any other application
errors to a label whose caption changes when clicked. I admit that I
don't have much experience with ActiveX controls, but VB makes it seem so
easy with the "File/NewProject/ActiveX Control": option. I have seem
several problems or Error using this control in VBA:
Error 459 "Object or Class does not support the set of events" or
"Object Not Found" or
"ObjectLibraryinvalid or contains references to object definitions
that could not be found"
I think I'm going crazy, I get the above errors at different times, but
can not see a pattern. I have maintained Binary compatibility with the
control, and have tried moving the OCX to a windows/system or
windows/system32 directory. Sometimes I run a new VBA project and
sometimes the saved project. I have recreated the OCX from scratch, but
have tried to unregistered, delete, compile, and replace the compatible
version of the OCX. I've done this before with ActiveX dll's that I've
created without any problems.
Now I can use this same control in a plan VB form without any
problems. Its seems to be something to do with VBA, either inside an
Office application or from IAPCIntegration inside my own VB app. Any
ideas? Thanks in advanced for any help.
I've included the test control code here:
Option Explicit
Private m_lstate As Long
Private Sub ClickLabel_Click()
If m_lstate = 0 Then
clicklabel.Caption = "Off"
m_lstate = 1
Else
clicklabel.Caption = "On"
m_lstate = 0
End If
End Sub
Private Sub ClickMain_InitProperties()
m_lstate = 0
End Sub