Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default 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   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default 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   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default Referencing Userform in VB6

Thanks a lot

Looks very promising. I am testing it

Avi
Reply
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
referencing Sheet from UserForm code Jock Excel Programming 3 October 15th 09 10:04 PM
Referencing a UserForm Patrick C. Simonds Excel Programming 3 September 7th 09 04:36 AM
Referencing a UserForm in a Module Patrick C. Simonds Excel Programming 2 September 2nd 09 08:40 PM
Referencing Userform Controls JeremyJ Excel Programming 0 January 10th 09 12:43 AM
Referencing UserForm event in module avi Excel Programming 2 September 2nd 07 05:53 PM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"