Reading through the forums, there seems to be some confusion on how to create an Excel Spreadsheet using the Kingsoft Spreadsheet package via Automation with Visual Basic 6.
Here is sample source code;
The free copy of Kingsoft Spreadsheet is available from http://www.kingsoftstore.com/spreadsheets-free.html
While this code was written for use with VBScript, it works the same in Visual Basic 6.
Elias
Here is sample source code;
Code:
Dim oExcel
Dim oBook
Dim oSheet
'Start a new workbook in Kingsoft Spreadsheet
Set oExcel = CreateObject("et.Application")
Set oBook = oExcel.Workbooks.Add
'Add data to cells of the first worksheet in the new workbook
Set oSheet = oBook.Worksheets(1)
oSheet.Range("A1").Value = "Last Name"
oSheet.Range("B1").Value = "First Name"
oSheet.Range("A1:B1").Font.Bold = True
oSheet.Range("A2").Value = "Dunn"
oSheet.Range("B2").Value = "Elias"
'Save the Workbook and Quit Excel
oBook.SaveAs "C:\utils\example.xls"
oExcel.Quit
'***********END***********
While this code was written for use with VBScript, it works the same in Visual Basic 6.
Elias