Open userform from different workbook

j844929

Active Member
Joined
Aug 18, 2002
Messages
423
Hi,

Can anyone tell me how to open a userform in one workbook by running code from a different workbook?

I have a workbook with a command button on a menu, which opens another workbook. After the other workbook is opened, I'd like another userform to appear, but one which is assigned to that particular workbook...

Tim
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

THink I have found a workaround, but I'm sure it is not what you want.

In the spreadsheet that is being opened, can you not create a macro for the userform e.g.

Code:
Sub A_SHOW()
UserForm1.Show
End Sub

Then in the original sheet your code will be

Code:
Sub Macro4()
    Workbooks.Open FileName:="C:\clock.xls"
    Application.Run "clock.xls!A_SHOW"
End Sub

Obviously substituting with your file and macro name.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,303
Messages
5,641,425
Members
417,209
Latest member
Agbarker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top