Using forms and modules from one workbook into another excel file

marlonsaveri

Board Regular
Joined
Jan 28, 2011
Messages
68
Hello, I build some modules and forms in a test file. However, routines, functions, etc. should run to another file, a "main file".
To "move" commands, I copied the modules from one and pasted it; I exported forms and imported them in the "main file"

However, every time I open this main workbook:

1. It asked twice to disable macros.

2. it opens the file test in order to use the forms. When I tried to save the file to my computer from a PenDrive; or two messagens appears to disable macros or it just save the old file, without enough data.

I don't know if it's important to say, but, in principle, this other file was not xlsm, but had a different format what opens in excel as well.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Not sure what it is you are trying to do - but here is what I understand

1) Program resides in one XLSM or XLAM file

2) your data reside in a normal XLSX

So if that is true simply run your user form - properly should load using

ThisWorkBook_open event


Code:
Private Sub Workbook_Open()
    Load NameOfUserform
    NameOfUserform.Show vbModeless 'If you use modeless you can still edit the sheet.
End Sub


- that way the userforms loads automatically - now open you XLS file with data - Not sure if this is what you are asking!
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,266
Members
452,902
Latest member
Knuddeluff

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