Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing Userform in VB6
Hello,
I have a userform in Excel ith some controls and activeXs on it Is there a way to reference the controls and the userform from VB6? Excel has not a Userform property... Thanks Avi |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing Userform in VB6
Hi Avi
The office userform and its controls are in the "Forms2" library. HTH. Best wishes Harald "avi" wrote in message ... Hello, I have a userform in Excel ith some controls and activeXs on it Is there a way to reference the controls and the userform from VB6? Excel has not a Userform property... Thanks Avi |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing Userform in VB6
avi has brought this to us :
Hello, I have a userform in Excel ith some controls and activeXs on it Is there a way to reference the controls and the userform from VB6? Excel has not a Userform property... Thanks Avi Not enough info! It depends where you have this userform, how you want to access it, and why you want to access it from VB6 rather than VBA within Excel. If you more fully explain what you're trying to do then better help can be provided. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing Userform in VB6
As others have implied it's very difficult to answer a question like this
without so little information. But FWIW you can use your Excel VBA userform in your VB6 app, providing it's for use with an Office app, say as an ActiveX dll for use with Excel. Regards, Peter T "avi" wrote in message ... Hello, I have a userform in Excel ith some controls and activeXs on it Is there a way to reference the controls and the userform from VB6? Excel has not a Userform property... Thanks Avi |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing Userform in VB6
Thanks everyone
I have a VBA application with some controls on UserForm1 of ActiveX type, lets say CircleGauge1, CircleGauge2... I want to be able to manipulate the controls property when the Userform is in run mode, for example changing the color of CircleGauge1 In order to it from VB6, I need that my VB6 program ( a dll) knows how to refer to UserForm1 and to its controls. The VB6 dll is referenced in Excel VBA Thanks Avi |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing Userform in VB6
Pass a reference to the form from the Excel project to the dll.
' in Excel dim frm as userform1 set frm = new userform1 set gVB6cls = new myVB6App.myClass Set gVB6cls.objFrm = frm ' Public objFrm as Object frm.show Or maybe declare gVB6cls in the form and in the form's initialize event set gVB6cls = new myVB6App.myClass Set gVB6cls.objFrm = Me In the myVB6App.myClass's initialize event set a global reference to self, eg Set gCls = Me Also include something like this Public Sub Bye() ' be sure to call this externally before destroying the class set gCls = nothing end sub Now anywhere in your VB6 app you can refer to gCls.objFrm and gCls.objFrm.myControl In the form's unload event first call gVB6cls.Bye then Set gVB6cls = nothing FWIW you can start your Excel form from VB6 using xlApp.Run, say to call a procedure to load the userform and do the above. Instead of passing the userform, objFrm, maybe it might be better to pass references to the controls you know you will want to handle in the VB6 app. In the VB6 you can't do - Dim objFrm as Userform1 but you might be able to do Dim myCtrl as ControlType ' ie early binding Regards, Peter T "avi" wrote in message ... Thanks everyone I have a VBA application with some controls on UserForm1 of ActiveX type, lets say CircleGauge1, CircleGauge2... I want to be able to manipulate the controls property when the Userform is in run mode, for example changing the color of CircleGauge1 In order to it from VB6, I need that my VB6 program ( a dll) knows how to refer to UserForm1 and to its controls. The VB6 dll is referenced in Excel VBA Thanks Avi |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing Userform in VB6
Thanks a lot
Looks very promising. I am testing it Avi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
referencing Sheet from UserForm code | Excel Programming | |||
Referencing a UserForm | Excel Programming | |||
Referencing a UserForm in a Module | Excel Programming | |||
Referencing Userform Controls | Excel Programming | |||
Referencing UserForm event in module | Excel Programming |