Pulling data from closed workbook of varying name

Vizeey

New Member
Joined
Jan 14, 2025
Messages
2
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Mobile
Hello,
I want to pull information from different files, with names based on input in a cell. I only managed to do this with Workbooks.Open, and I am now looking for a way to pull the information without the need to open the target workbook.
With the help of ExcelGPT I got this function and sub (picture).
I added the variables "wrkID", "ipd", "nummer" and "mtf" as ways to create the path for the desired files.

The script produces no errors, but inputs a #VALUE in the output cell.
I am very new to the use of "Application.Evaluate()", and dont know where the error occurs.
Please let me know of there are any more information needed to solve this issue.

Mathias
 

Attachments

  • Skjermbilde 2025-01-14 132626.png
    Skjermbilde 2025-01-14 132626.png
    79.8 KB · Views: 4

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hello,

As far as I know with VBA/formulas you will need to open the workbook to retrieve data. If you aim to keep them closed, you should use PowerQuery. Especially if you want to import whole tables for example.

Look in DATA > GET DATA > From File > From Excel workbook.
 
Upvote 0

Forum statistics

Threads
1,225,738
Messages
6,186,736
Members
453,369
Latest member
juliewar

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