Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an excel worksheet without instaled excel

Status
Not open for further replies.
Aug 5, 2002
7
0
0
AR
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 have not used ADO so cannot comment on what you have coded, but I have successfully used the XLSWrite component available from If you want to know the internal format of Excel files, you may find it on which contains many formats.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top