Get Workbook Object properties without opening Workbook?

S

SixSigmaGuy

I have an application that walks through all the Excel files in a huge
directory tree and, for each Excel file it finds,
1. It opens the Excel file,
2. checks the Workbook Object properties of that file,
3. If it finds the property setting I'm looking for, it processes that
file,
4. Closes the file,
5. Moves to the next file, goto step 1.

My problem is that the files are often very large and it takes a long time
to open each one, and there are several thousand files. Is there anyway I
can get the Workbook Object properties from an Excel Workbook without
actually opening the file?

A related problem is that many of the Excel files in the directory tree have
VBA code in Workbook_Open event that gets executed each time I open a file.
I don't want to execute that code; I just want to get the properties.

The property I am examining is the Theme property; but I will need to check
others later; thus, a solution that works only for the Theme property won't
help me.

Thanks!!

P.S., I thought GetObject would do the trick, but it also causes the file to
be opened.
 
W

ward376

You can use application.enableevents=false to keep code from running
when files open. Sorry, I can't help with the Object properties.

Cliff Edwards
 
J

JP

It would help if you posted the code you are using, mentioned what
version of Excel you are using, and what the purpose of your routine
is.

--JP
 
W

ward376

SixSigmaGuy - did you work out getting the workbook properties without
opening the files?

Cliff Edwards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top