Call userform from another workbook

04011988

New Member
Joined
Sep 23, 2018
Messages
26
Hi,

Is it possible to call userform from another workbook?

I don't want to use the existing file as I don't want people from seeing the other workbook which includes confidential info. But I just want the userform from that existing be available for them when maybe run a macro from another workbook. So the workbook from that existing file must not be visible but only the userform.
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi,

Is it possible to call userform from another workbook?

I don't want to use the existing file as I don't want people from seeing the other workbook which includes confidential info. But I just want the userform from that existing be available for them when maybe run a macro from another workbook. So the workbook from that existing file must not be visible but only the userform.

One way is to add a public macro to the workbook containing the userform and then call that macro from the calling workbook using the Run Method ... Something like this :

In a standard module in the userform vbproject
Code:
Public Sub ShowUserForm()
    UserForm1.Show
End Sub
In the calling vbproject
Code:
Application.Run "OtherWorkbookName!ShowUserForm"
 
Upvote 0
One way is to add a public macro to the workbook containing the userform and then call that macro from the calling workbook using the Run Method ... Something like this :

In a standard module in the userform vbproject
Code:
Public Sub ShowUserForm()
    UserForm1.Show
End Sub
In the calling vbproject
Code:
Application.Run "OtherWorkbookName!ShowUserForm"

Hi Jaafar,

Thank you for your response. Just now that I was able to work on it again. And the code works. However, I got a problem when the userform pop out by calling it to another workbook, the combobox list did not show up from the userform. But if I ran the userform using the original workbook, combobox works.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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