NicolasDeMarco
MIS
I want to create an excel worksheet with an only tab (sheet) in a machine that has not Excel installed.
I could do this, by copying a preexisting empty worksheet with ADO, then I open the new connection (ConnectionString :=
'Provider=Microsoft.Jet.OLEDB.4.0;' +
'Extended Properties="Excel 8.0;HDR=Yes;";' +
'Data Source="' + Trim(FileName) + '"'
Second step: I create a new table (creating a new tab=sheet) issuing the following TADOQryExecute:
"Create table newtable (field1 N, fiel2 Char(5)". It works fine.
After create the new table (sheet), when I want to delete the original tab of the preexisting worksheet, in order to be an only sheet (tab), I receive a message "Table Sheet1 does not exists". I use the following ADOQryExecute: "DELETE SHEET1".
I want explain that, in design mode, if I open the preexisting worksheet (Connection Active=True), the Delphi interfase shows me a table (sheet) named "Sheet1"
Is there an other way to do this?. Does exists any documentation about the layaut of an excel sheet, in order to write a file in excel format?
Tanks all you
Nicolás (Argentina)
I could do this, by copying a preexisting empty worksheet with ADO, then I open the new connection (ConnectionString :=
'Provider=Microsoft.Jet.OLEDB.4.0;' +
'Extended Properties="Excel 8.0;HDR=Yes;";' +
'Data Source="' + Trim(FileName) + '"'
Second step: I create a new table (creating a new tab=sheet) issuing the following TADOQryExecute:
"Create table newtable (field1 N, fiel2 Char(5)". It works fine.
After create the new table (sheet), when I want to delete the original tab of the preexisting worksheet, in order to be an only sheet (tab), I receive a message "Table Sheet1 does not exists". I use the following ADOQryExecute: "DELETE SHEET1".
I want explain that, in design mode, if I open the preexisting worksheet (Connection Active=True), the Delphi interfase shows me a table (sheet) named "Sheet1"
Is there an other way to do this?. Does exists any documentation about the layaut of an excel sheet, in order to write a file in excel format?
Tanks all you
Nicolás (Argentina)