Some ActiveX controls require a form to work. It may be because of how they interact with Windows and they need something with a windows handle (hWnd). IAC, do you need it to function in a manner other than the one it works in now? Can you simply create a form outside of the viewable area or not make the form visible if you don't want it to show?
Regards.
>Hi
>
>If I subclass an ActiveX control and then try to create it as follows I get the error "Object class is invalid for this container":
>
>lo=CreateObject("oleVPE")
>
>If I use:
>
>lo=CreateObject("VPEControl.VPEControl.35")
>
>everything works fine.
>
>If also works fine if I do:
>
>lo=CreateObject("Form")
>lo.AddObject("VPE","oleVPE")
>
>But this fails:
>
>lo=CreateObject("Container")
>lo.AddObject("VPE","oleVPE")
>
>
>Thanks
>Simon
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao