Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions,microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
#4
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
ADODB.Recordset is probably not going to work for you. It is basically a way
or reading a database. To the best of my knowledge it will not handle reading file properties. You could look into an XL4 macro which will not require the file to be open. That being said I do not know of any XL4 macros to do what you ask... -- HTH... Jim Thomlinson "4everDad" wrote: 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! |
#5
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Yes, RecordSet reads the worksheets. I was hoping Connection (or
something else) in OLE DB would make that workbook property accessible. Argh! On Mar 3, 2:15 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move- This-.com wrote: ADODB.Recordset is probably not going to work for you. It is basically a way or reading a database. To the best of my knowledge it will not handle reading file properties. You could look into an XL4 macro which will not require the file to be open. That being said I do not know of any XL4 macros to do what you ask... -- HTH... Jim Thomlinson "4everDad" wrote: 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! |
#6
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.oledb,microsoft.public.data.oledb
|
|||
|
|||
![]()
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. On Mar 3, 3:43 pm, 4everDad wrote: Yes, RecordSet reads the worksheets. I was hoping Connection (or something else) in OLE DB would make that workbook property accessible. Argh! On Mar 3, 2:15 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move- This-.com wrote: ADODB.Recordset is probably not going to work for you. It is basically a way or reading a database. To the best of my knowledge it will not handle reading file properties. You could look into an XL4 macro which will not require the file to be open. That being said I do not know of any XL4 macros to do what you ask... -- HTH... Jim Thomlinson "4everDad" wrote: 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! |
#7
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.oledb,microsoft.public.data.oledb,microsoft.public.data.ado
|
|||
|
|||
![]()
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. On Mar 3, 3:43 pm, 4everDad wrote: Yes, RecordSet reads the worksheets. I was hoping Connection (or something else) in OLE DB would make that workbook property accessible. Argh! On Mar 3, 2:15 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move- This-.com wrote: ADODB.Recordset is probably not going to work for you. It is basically a way or reading a database. To the best of my knowledge it will not handle reading file properties. You could look into an XL4 macro which will not require the file to be open. That being said I do not know of any XL4 macros to do what you ask... -- HTH... Jim Thomlinson "4everDad" wrote: 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! |
#8
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.oledb,microsoft.public.data.oledb,microsoft.public.data.ado
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can anyone help with workbook properties please? | Excel Worksheet Functions | |||
remove read only - not showing up in properties | Excel Worksheet Functions | |||
XL Workbook Properties | Excel Discussion (Misc queries) | |||
Workbook Properties | Excel Discussion (Misc queries) | |||
Using OleDB to get data from Excel | Excel Discussion (Misc queries) |