Opening Userform1 in Book1 from a button on Userfrom2 in Book2

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
918
Office Version
  1. 365
Platform
  1. Windows
Names in title are generic for simplicity. I can replace those with the correct file name(s) and Userform(s)
I can't figure out how this can be done.
This is the actual File path where File with NewDEForm (actual form name) is located:
Code:
C:\Users\car19\Dropbox\2024 .xlsm
This is rhe actual Userform name that needs to be opened by Book2:
Code:
NewDEForm

How would I open NewDEForm from Book2 ? I tried this - it generates an error:
From a button click in Book2:
Code:
C:\Users\car19\Dropbox\2024 .xlsm\NewDEForm

Any help would be greatly appreciated.

cr
 

Attachments

  • OPENING A USERFORM FROM ANOTHER WORKBOOK.png
    OPENING A USERFORM FROM ANOTHER WORKBOOK.png
    60.1 KB · Views: 7

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
First you need to prepare a sub in a public module in Book1 which opens UserForm1. Something like:
VBA Code:
Public Sub openForm()
    NewDEForm.show
End Sub
Save Book1.

then in Book2 you do something like this:
VBA Code:
set wb = Application.Workbooks.Open ("C:\Users\car19\Dropbox\2024 .xlsm")
Application.Run ("'" & wb.name & "'!openForm")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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