Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Userform Control Change from Different Workbook

I would like to change a Userform Control value in a different
workbook before I load it from again, a different workbook.

WorkbookA.xla - Contains said Userform. I do not want to change
anyprogramming in this xla. I only want to reference a given userform
control therein and change its value remotely.

WorkbookB.xls - Will have the routine to change said control value,
then show the form (already know how to do the later).

This would be easy from all the same sheet. Any thoughts? Again, it
is a contstraint that I cannot change the xla... just can't figure out
how to address the object.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Userform Control Change from Different Workbook

Oh, and I'm trying to support both '03 & '07! Thanks again!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Userform Control Change from Different Workbook

Unusual!

AFAIK not possible to access the form in the other book until its loaded, so
you will need to add something to the other addin

' in a normal module, not headed Private in the xla
Function GetUF() As UserForm1
Set GetUF = UserForm1
End Function


' in the calling workbook
Sub test()
Dim myForm As Object

Set myForm = Application.Run("myAddin.xla!GetUF")

myForm.Controls("CommandButton1").Caption = "Hello"

myForm.Show

End Sub


If it's viable to set a reference to your addin,
Set myForm = myAddinProjectName!GetUF")

I would have thought much better to call a routine in the addin, pass
arguments for new control properties, and have that routine load the form,
do the changes and run the form. When done pass back any results to the
calling workbook.

Regards,
Peter T


"J Pietsch" wrote in message
...
I would like to change a Userform Control value in a different
workbook before I load it from again, a different workbook.

WorkbookA.xla - Contains said Userform. I do not want to change
anyprogramming in this xla. I only want to reference a given userform
control therein and change its value remotely.

WorkbookB.xls - Will have the routine to change said control value,
then show the form (already know how to do the later).

This would be easy from all the same sheet. Any thoughts? Again, it
is a contstraint that I cannot change the xla... just can't figure out
how to address the object.

Thanks!



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
Change from userform view to excel workbook view SEWarren Excel Programming 1 September 6th 07 02:18 AM
Selecting control on userform with part of control name (set question) Keith Excel Programming 4 January 10th 07 02:24 PM
Control Sequence from Userform Control Nigel Excel Programming 3 December 29th 04 01:25 PM
Userform control ZMore Excel Programming 1 March 5th 04 11:34 PM
Userform control Phillips Excel Programming 1 November 20th 03 07:33 PM


All times are GMT +1. The time now is 08:36 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"