I know how to run a macro that resides in a module in another workbook.
Application.Run "'MacroSource.xls'!Macro1"
What I would like to do is control an object that resides on a user form in another workbook and I’m having problems with the statement. For example, I like to have a user press a command button on UserForm1 which resides in Book1.xls and change the caption on Label1 of the same form with Macro1 from a module of another book called MacroSource.xls. The statement above will allow me to execute Macro1 from Book1.xls. Where I need help is the Macro1 procedure.
Sub Macro1()
Book1.xls UserForm1.Label1 = "Hello"
End Sub
How do I properly combine the above statement to control Label1 on UserForm1 in Book1.xls from Macro1 which resides in a module in MacroSource.xls?
Application.Run "'MacroSource.xls'!Macro1"
What I would like to do is control an object that resides on a user form in another workbook and I’m having problems with the statement. For example, I like to have a user press a command button on UserForm1 which resides in Book1.xls and change the caption on Label1 of the same form with Macro1 from a module of another book called MacroSource.xls. The statement above will allow me to execute Macro1 from Book1.xls. Where I need help is the Macro1 procedure.
Sub Macro1()
Book1.xls UserForm1.Label1 = "Hello"
End Sub
How do I properly combine the above statement to control Label1 on UserForm1 in Book1.xls from Macro1 which resides in a module in MacroSource.xls?