Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Get Workbook Object properties without opening Workbook?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SixSigmaGuy - 25 May 2008 02:54 GMT
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.
ward376 - 25 May 2008 04:33 GMT
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
JP - 25 May 2008 14:11 GMT
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

> I have an application that walks through all the Excel files in a huge
> directory tree and, for each Excel file it finds,
[quoted text clipped - 13 lines]
> 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.
ward376 - 29 May 2008 05:57 GMT
SixSigmaGuy - did you work out getting the workbook properties without
opening the files?

Cliff Edwards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.