/////////////////////////////////////////////////////////////////////////////////////////////////////// // Converting DataWindow to Excel file /////////////////////////////////////////////////////////////////////////////////////////////////////// // Export DataWindow to Excel including computed-columns, headers, footers, groups, text labels, etc... /////////////////////////////////////////////////////////////////////////////////////////////////////// // ... Init docname // ... GetFileOpenName or any other method // IF dw.SaveAs( docname, HTMLTable!, TRUE ) = -1 THEN MessageBox("Warning", "Unable to export data. Error writing to file!", Exclamation!) RETURN ; END IF ; // // Convert HTML file to Excel native format OLEObject Excel ; // Excel = CREATE OLEObject ; // IF Excel.ConnectToObject( docname ) = 0 THEN Excel.Application.DisplayAlerts = FALSE ; Excel.Application.Workbooks( 1 ).Parent.Windows( excel.Application.workbooks( 1 ).Name ).Visible = TRUE ; Excel.Application.Workbooks( 1 ).SaveAs(docname, 39 ) ; Excel.Application.Workbooks( 1 ).Close() ; END IF ; // DESTROY excel // // ...Done