Results 1 to 2 of 2

Thread: Kingsoft Spreadsheet and VB6

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2014
    Posts
    16

    Kingsoft Spreadsheet and VB6

    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;
    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***********
    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

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Kingsoft Spreadsheet and VB6

    That code looks identical to how you would write the code for use with Excel are you use a different product to create the xls files? If so you should change "Excel" in the above to reflect the software you are using. Also, VB6 should have proper types:

    Code:
    Dim oExcel Dim oBook Dim oSheet
    should be

    Code:
    Dim oExcel As Object, oBook As Object, oSheet As Object
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width