ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   remote writing to userforms (https://www.excelbanter.com/excel-programming/341779-remote-writing-userforms.html)

tad_wegner

remote writing to userforms
 

I am trying to write to a userform from a macro. Consequently, the
userform is a part of a macro of another workbook (workbook-B).

I wrote a macro in workbook-A... it activates a macro in workbook-B.
Part of workbook-B's subroutine opens a userform that requires addition
info. I have the data to populate the userform, but do not know how to
insert the data into the userform from the macro in workbook-A.

Anyone have any experience here?


--
tad_wegner
------------------------------------------------------------------------
tad_wegner's Profile: http://www.excelforum.com/member.php...o&userid=27770
View this thread: http://www.excelforum.com/showthread...hreadid=472818


Bob Phillips[_12_]

remote writing to userforms
 
You could pass the values to tye macro as arguments, and then use those
value as properties in the userform and load there.

Workbook A

Application.Run "WorkbookB.xls!that_macro", 4,8

Workbook B
Standard module

Sub that_macro(a,b)
Userform1.Value1 = a
Userform1.Value2 = b
Userform1.Show
End Sub

Userform

Public Value1 as Long
Public Value2 As Long


"tad_wegner" wrote
in message ...

I am trying to write to a userform from a macro. Consequently, the
userform is a part of a macro of another workbook (workbook-B).

I wrote a macro in workbook-A... it activates a macro in workbook-B.
Part of workbook-B's subroutine opens a userform that requires addition
info. I have the data to populate the userform, but do not know how to
insert the data into the userform from the macro in workbook-A.

Anyone have any experience here?


--
tad_wegner
------------------------------------------------------------------------
tad_wegner's Profile:
http://www.excelforum.com/member.php...o&userid=27770
View this thread: http://www.excelforum.com/showthread...hreadid=472818





All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com