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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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.
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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
Back
Top