ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get Properties Of Closed Workbooks (https://www.excelbanter.com/excel-programming/366310-get-properties-closed-workbooks.html)

MDW

Get Properties Of Closed Workbooks
 
Is there a way to get access to certain characteristics of an Excel workbook
file without having to open it? In particular, I'd like to read the value in
the DefaultDocumentProperties("Category") - I have no need or interest to
make any changes to the file, and so I don't need to open it.

Thanks.
--
Hmm...they have the Internet on COMPUTERS now!

Chip Pearson

Get Properties Of Closed Workbooks
 
The easiest way is to use the DSO Property reader. Download from
http://support.microsoft.com/Default.aspx?id=224351

Then, in VBA go to the Tools menu, choose References, and check
the box for "DSO OLE Document Properties Reader 2.0". Once you
have this reference, you can use code like

Dim DocProps As DSOFile.OleDocumentProperties
Set DocProps = New DSOFile.OleDocumentProperties
DocProps.Open "H:\Book1.xls"
Debug.Print DocProps.SummaryProperties.Category
DocProps.Close



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"MDW" wrote in message
...
Is there a way to get access to certain characteristics of an
Excel workbook
file without having to open it? In particular, I'd like to read
the value in
the DefaultDocumentProperties("Category") - I have no need or
interest to
make any changes to the file, and so I don't need to open it.

Thanks.
--
Hmm...they have the Internet on COMPUTERS now!





All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com