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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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