Workbook custom document properties

N

Nigel Barton

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,
 
J

Jacob Skaria

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
 

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