View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default 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