Return value of named constant without opening workbook

stefankemp

Board Regular
Joined
Mar 11, 2010
Messages
136
I am importing data from multiple workbooks in a folder using ADO. But I only want to connect to workbooks where the value of a named constant within each workbook, "isTemplate", is True. Is there a way to check this value without opening the workbook? Perhaps via ADO? Or alternatively to simply check for the existence of the name?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I think you can use an XLM4 macro constant for this (or write a suitable formula to a worksheet cell and check the results). Let me see if I can remember the relevant post...
 
Upvote 0
It seems you can't use the ExecuteExcel4Macro approach I thought might work (unless the named constant is a single cell range - then it could/should work).

And it seems you can't refer to a named constant in another (closed) workbook either (so I was wrong on both counts).
 
Upvote 0
Thanks. I ended up putting a value in a cell in a hidden sheet for each workbook that needs to be imported, and using ExecuteExcel4Macro to check its value.
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,825
Members
449,470
Latest member
Subhash Chand

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