ExcelXML.py is a python module to generate Excel spreadsheet in XML format (Excel 2003).

It don't require any installation of MS-Excel product.

See test programs as an example of how to use this module.
(sorry for the italian language in comments!)

You can run TestExcel1.py and TestExcel2.py as is and see result files Prova1.xml and Prova2.xml.
TestSQLExelExport.py requires PythonWin, and the connection string and Select statement 
in source file must be changed.

Query2Excel.py is a python utility program with a GUI interface to connect and export from
a database; requires wxPython and PythonWin.



In brief:

- Istantiate  xlsSheetStruct and xlsStyleStruct if you want to change styles used.
  See the source to view the values you can change in this structures, and how

- Istantiate  xlsExcel([FileName], [Author], [DefaultSheetInstance]) 
  to initialize the spreadsheet and save it into FileName (mandatory) 


  Recall methods:

- xlsAddStyle(StyleInstance) 
  to define one or more cell style (optional)


- xlsAddSheet(SheetName, [SheetInstance])
  To initialize a new sheet (mandatory)
  Recall at least one time.


- xlsColumn(ColumnNumber, Width)
  after xlsAddSheet, if you want enlarge one or more columns (optional)


- xlsWriteCell(Value, [Type, IDstile, formula, skipCol, MergeAcross, MergeDown])
  
  use this many times to write 'values' in the cells, sequentially from 
  left to right and from top to bottom.
  Type can be: "S" (string, default) "N" (number)
  IDstile is the ID of the wanted style of the cell
  formula is a valid string used as a formula for this cell
  skipCol jumps over cells toward right
  MergeAcross, MergeDown extend the cell to right or down

- xlsNewLine([skip], [RowWidth], [IDStile])
  to pass to the next line

- xlsClose()
  close all (mandatory)


You can also Merge an existing Excel (always XML) with new sheets instantiating:

  - xlsExcel([NewFileName], OldExcelFile="FileOld")

    old sheet are copied in NewFileName and new sheets are at the end; 
    before using xlsAddSheet method, you can use:

  - xlsSheetDelete(OldSheetName)

    to exclude old sheets in the new file (also more times).

You cannot change the data of an existing sheet.

