View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.oledb,microsoft.public.data.oledb,microsoft.public.data.ado
Bob Barrows [MVP] Bob Barrows [MVP] is offline
external usenet poster
 
Posts: 2
Default How to read workbook (not worksheet) properties with OLEDB

4everDad wrote:
Thank you, Roger & Jim. If any one else can figure out how to use
OLEDB to access the workBOOK properties of an Excel file (and not just
the workSHEET data, see prior posts), please reply and I will be very
grateful.


Don't hold your breath :-)
Your only hope is to find this property in the dynamic properties
supplied by the OLE DB provider. Loop through them and inspect the
property names and values:

for each p in cn.properties
msgbox p.name 'or print it somewhere
msgbox p.value 'or print it somewhere
next

You might also look in the recordset's Properties collection.
If you find the property you need, more power to you. If not, find
another solution: you've confirmed that this property is not exposed to
OLE DB. Perhaps use an Excel macro to store the propety value as data in
your spreadsheet.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.