In Excel 2019 VBA, how can I ''import'' an .XLS file into an existing open .XLSM workbook?

Joined
Jun 22, 2020
Messages
4
Office Version
  1. 2019
  2. 2007
Platform
  1. Windows
I searched this forum and Google and cannot find anything that doesn't also mention Google sheets for some reason.

Anyway, I have an open workbook.

Through VBA, I need to open an XLS file for further processing.

The processing part is easy.

Getting the file to "import" I cannot figure out.

On the VBA UserForm, the file name isn't known until the user selects it, so a variable will need to be included in the code.

I tied just opening the sheet, witching to it, copying the data, creating a new sheet in the open one, but that didn't work.

Then I tried moving that sheet to the open workbook That didn't work either.

I am surprised this is so complicated (for ME.)

So, can one of you absolute gurus tell me, through VBA, to open the XLS file right into the existing workbook?

Thank you all in advance for your amazing genius!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I got it working - not sure how I did it, but I did!

I tried to delete the original post, but didn't see a delete button.

Admin - please delete.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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