LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Using Userform object in Excel via automation from VB 6

Hi all,

I don't have VB now and I don't know the original post so what I wrote may
wide of the mark...
It is a way for showing a userform from the from name(string).

'----------------------------------------
VBA.UserForms.Add(objUserform.Name).Show
'----------------------------------------

Excuse me for disturbing you. :D


Kind Regards
Colo
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Colo of 'The Road of The Cell Masters' :)

URL:http://www.interq.or.jp/sun/puremis/...astersLink.htm


/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


"Howard Kaikow" wrote in message
...
"Stephen Bullen" wrote in message
...
Hi Howard,

What I really wanted to do was:

With objExcelProject.VBComponents(objUserform.Name)
.Caption = "bye bye!"
.Show
End With

However, the Caption does not get changed.


I probably don't want to know <g, but why are you trying to create the
form within the workbook, show it and delete it?


I was using the example in John Walkenbach's book for purposes of
discussion.

Why don't you just
have a form in the VB6 project?


It has to be a Userform that is run via Automation.

Referencing the VBComponent as you've done returns a VBComponent
object, not a UserForm object, so you can't set the properties
directly.


Is there a way to reference the created Userform directly?
I 've not found a way to do that.

However, the VBComponent does have a Properties collection
that contains all the properties you see in the Properties window when
you click on a userform. Hence, the following works for me:

With objExcelProject.VBComponents(objUserform.Name)
.Properties("Caption") = "bye bye!"
.Show
End With


The .Show still does not work.

If I cannot directly access the Userform object, and, more importantly,

the
controls in the VB code, then I'll do things by generating code for
Userform_Initialize, etc.



 
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
Using Excel with automation Thomas Bodell Excel Discussion (Misc queries) 5 May 8th 09 03:09 PM
Ole automation with Excel 10 from Vb.net Richie Weldon \(MSFT\) Excel Programming 0 November 13th 03 06:08 PM
unable to create embedded object on a userform Robert Nobles Excel Programming 0 September 9th 03 08:49 PM
Automation Error: The Object Invoked Has Disconnected from Its Clients (Excel) Vaibhav Excel Programming 0 September 8th 03 04:57 PM
Automation Error: The Object Invoked Has Disconnected from Its Clients Vaibhav Dandavate Excel Programming 0 September 8th 03 04:05 PM


All times are GMT +1. The time now is 08:52 AM.

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

About Us

"It's about Microsoft Excel"