All Kingsoft Office applications (Kingsoft Writer, Kingsoft Spreadsheets and Kingsoft Presentation) are API compatible with Microsoft Office application automation. This allows you to automate Kingsoft applications through VBA. The example provided here shows how to automate Kingsoft Spreadsheets using VBScript. The original Microsoft Excel script came from Microsoft KB article 247412.

Automating Kingsoft Spreadsheets
Before you can use any scripts written for Microsoft Excel, you will need to replace all instances of Excel.Application with et.Application. Copy the below code into a text file named example.vbs. This code will open Kingsoft Spreadsheets, add two rows of data, and save the file to C:\TEMP\example.xls.
‘***********BEGIN***********
Dim oExcel
Dim oBook
Dim oSheet
‘Start a new workbook in Kingsoft Presentation
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 = "Doe"
oSheet.Range("B2").Value = "John"
‘Save the Workbook and Quit Excel
oBook.SaveAs "C:\TEMP\example.xls"
oExcel.Quit
‘***********END***********
Related Articles
- Kingsoft Office 2009 supports Microsoft Office (Word/Excel) API compatible OLE/C...
- Kingsoft Office 2009 is compatible with Microsoft Office Open XML (OOXML) format...
- Kingsoft Spreadsheets can convert a Microsoft Excel workbook (XLS/XLSX/CSV/DBF) ...
- Microsoft Office Alternative: Kingsoft (WPS) Office 2009
- Kingsoft Spreadsheets is an alternative to Microsoft Excel 2003 that can open, v...
kingsoft vba (2), Kingsoft Office 2010 vba (2), Kingsoft CreateObject (2), add-in for kingsoft spreadsheet (1), office 2010 vbscript oSheet Range(A1) (1)
