ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook custom document properties (https://www.excelbanter.com/excel-programming/432176-workbook-custom-document-properties.html)

Nigel Barton

Workbook custom document properties
 
I would like to know how document properties can be read within Visual Basic
without opening the workbook.

I have a set of workbooks in a folder, but want to open only those that have
a particular value within one of the custom properties.

Thanks,
--
Nigel Barton

Jacob Skaria

Workbook custom document properties
 
Hi Nigel

From Visual Basic use the below code to get the document properties. You can
probably loop and check for the files...

Set objXL = CreateObject("Excel.Application")

Set objwb = objXL.Workbooks.Open("c:\1.xls")
MsgBox objwb.BuiltinDocumentProperties("Author")
objwb.Close False

objXL.quit
Set objXL = Nothing
Set objwb = Nothing

The built-in document property names are as follows...
Title
Subject
Author
Keywords
Comments
Template
Last Author
Revision Number
Application Name
Last Print Date
Creation Date
Last Save Time
Total Editing Time
Number of Pages
Number of Words
Number of Characters
Security
Category
Format
Manager
Company
Number of Bytes
Number of Lines
Number of Paragraphs
Number of Slides
Number of Notes
Number of Hidden Slides
Number of Multimedia Clips
Hyperlink Base
Number of Characters (with spaces


If this post helps click Yes
---------------
Jacob Skaria


"Nigel Barton" wrote:

I would like to know how document properties can be read within Visual Basic
without opening the workbook.

I have a set of workbooks in a folder, but want to open only those that have
a particular value within one of the custom properties.

Thanks,
--
Nigel Barton



All times are GMT +1. The time now is 09:18 AM.

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