Reading a closed workbook

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
I want to create a macro that allows me to search for particular string in a worksheet of a closed workbook. The idea is to have a textbox on a form in which I can type in a string, "something". The macro would then try to find such a string in sheet1, for example, in a closed workbook. If this string is found, it will report the name of the workbook where this string is located. I will have this routine in a loop to read any number of workbooks to perform this search routine. How to accomplish this? I don't even know how to start.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Dave,

I'm not aware of a way to do what you're describing that wouldn't be very slow relative to other file search options.

Excel appears to "read" closed workbooks that are referenced by worksheet formulas or data connections, but that's only because the data has been read into Excel upon opening the workbook and updating the links.

If you wanted to search a folder with a large number of Excel files you could have a macro open each one and search for the string, but this would be very slow compared to Search Apps like Windows Search Desktop or Google Add-Ins.
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,818
Members
452,946
Latest member
JoseDavid

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