LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions,microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to read workbook (not worksheet) properties with OLEDB

Roger, Thank you for replying. I am aware of that property (Date1904)
when I use Automation to open Excel as an Application object from
within a database language. I can do that easily in the Application
object. But I can't do that from the server since Excel is not
installed on the server. I need to do it in OLEDB if at all
possible. My problem is that while I can see and iterate the
worksheet values, I don't seem to know how to view the workbook or if
it is even possible from OLEDB. And my attempts to use
"ActiveWorkbook.Date1904" failed no matter which combination I used.

objCn = CreateObject("ADODB.Connection")
objRs = CreateObject("ADODB.Recordset")
objCn.ConnectionString = [Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=]+myXlsFile+[;Extended Properties='Excel 12.0;HDR=No;IMEX=1']

I guess the problem is that OLEDB is a bit of a black box and I don't
even know whether the methods or properties I need are there...


On Mar 2, 6:41 am, "Roger Govier" <roger@technology4unospamdotcodotuk
wrote:
ActiveWorkbook.Date1904

Returns True when set
--
Regards
Roger Govier

"4everDad" wrote in message

I am attempting to read a workbook's properties such as Date1904.
Using brute force I discovered the flag in byte 765 of some .XLS
files, but I presume that the location is undocumented and unreliable
across all current and future versions of Excel. I need to verify
that 4 year offset (1462 days) but have no idea how to view workBOOK
properties with OLEDB which I already use to view worksheets.


I know I could open the Excel Workbook Object as an Application, but I
am running this on a web server and opening an instance of Excel isn't
scalable - it takes a couple seconds each time to open. Besides, I
don't have the latest Excel for the new 2007 file versions. Is there
another way to get the workbook properties using OLEDB such as the
flag for Date1904? Thanks!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read workbook (not worksheet) properties with OLEDB 4everDad Excel Worksheet Functions 7 March 5th 08 01:58 PM
How to read workbook (not worksheet) properties with OLEDB ForeverDad Excel Programming 0 February 29th 08 11:52 PM
New user help and Excel read question (Interop and OleDb) sporadic Excel Programming 0 June 2nd 05 08:18 PM
New user help and Excel read question (Interop and OleDb) sporadic Excel Programming 0 June 2nd 05 07:55 PM
New user help and Excel read question (Interop and OleDb) sporadic Excel Programming 0 June 2nd 05 03:40 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"