Excel VBA code to look through all open instances of excel

ben_sorensen

New Member
Joined
Jun 11, 2015
Messages
44
I have written a code that looks for specific data in a different workbook, but the issue that I am having now is that it won't look through other open instances of excel, which is driving me crazy! If anybody has any insights in how to make excel look into ALL open instances of excel I would really appreciate the help.

Here is my code on searching for the workbook:

Workbooks(Trim(Sheets("General Manager Report").Range("C6").Value)).Sheets("Demand Planning").Range("A1:DZ250").Copy

I am desperate, every time I look something up and try and add it into the it pops an error.

Thanks for looking!

Best
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Great thanks for posting


So I added the things from the post and now it is popping an error on me, here is my code:

Set xlApp = GetObject(Workbooks(Trim(Sheets("General Manager Report").Range("C7").Value))).Application.Sheets("Demand Planning").Range("A1:DZ250").Copy

Any help would be super appreciated!

Best
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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