Access data from a closed workbook

madvogue29

New Member
Joined
Aug 28, 2020
Messages
32
Office Version
  1. 365
Platform
  1. Windows
Hi all!

I have a report that is generated weekly for example 2401, 2402, 2403 etc. Is there a way that i can access data of these workbook from a master sheet. I have a formula that basically concatenates to the sheet name eg P:\weekly exports\2404.xlsm
Is there a formula or vba that lets me access data from this wb using the value from the concatenated name like cell F20 from the sheet and input it in Cell F25 in the masterworkbook sheet 1 ?

Thanks,
Mo
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Your question doesn't quite reflect the title, so I'll go with the title of the thread.
No, you cannot get data from a closed wb. However, you can open a wb hidden and copy the data using code in the wb that you already have open (Master?). There are tons of hits if you Google how to open a wb hidden, and how to copy from other workbooks. Or maybe you'll find code that does both rather than having to piece the parts together. The code would use your cell reference to know where the file is, which is what I think you asked.
 
Upvote 0
Your question doesn't quite reflect the title, so I'll go with the title of the thread.
No, you cannot get data from a closed wb. However, you can open a wb hidden and copy the data using code in the wb that you already have open (Master?). There are tons of hits if you Google how to open a wb hidden, and how to copy from other workbooks. Or maybe you'll find code that does both rather than having to piece the parts together. The code would use your cell reference to know where the file is, which is what I think you asked.
Thanks for updating the title. I can access data from unopened workbook like this ='P:\Test\[Book1.xlsx]Sheet1 (2)'!$A$1 however if i use concatenate to form this combination it doesnt work.
 
Upvote 0
Would Indirect work somehow ? i tested but i get #ref with the same reference
 
Upvote 0
If the title was updated, that's not me - not something I can do. I neglected to mention that I was answering the "VBA" portion of the options you mentioned. Formulas are not my thing. At my age, I have a better chance of winning the lottery than me becoming a formula guru. :)
 
Upvote 0
Try disabling the Do Events line and see if that makes any difference.
 
Upvote 0

Forum statistics

Threads
1,223,882
Messages
6,175,166
Members
452,615
Latest member
bogeys2birdies

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