Results 1 to 5 of 5

Thread: How do I do this? (EXCEL)

  1. #1

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    How would i open an instance of excel, all through my program, then populate a sheet with say
    a table like this :

    Name | Eye COlor | Nickname | Etc
    ---------------------------------
    David|Blue |Da_Silvy | Etc

    and then print it out

    does anyone know?

  2. #2

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    please help, it's urgent

  3. #3
    New Member
    Join Date
    May 2000
    Location
    South Africa
    Posts
    2

    Wink Excel Automation

    Hi David
    First you have to reference the Excel library in Projects/Reference Menu in VB6.
    Then you create a ExcelApp Object and a Worksheet object.

    The Worksheet Object has a Cells or a Range object that you can manipulate.

    Try the following code:

    Dim objExcel as Excel.Application
    Set objExcel = New Excel.Application
    objExcel.Visible = True
    objExcel.SheetsInNewWorkbook = 1
    objExcel.Workbooks.Add

    With objExcel.ActiveSheet
    .Range("A1").value = "Heading 1"
    .Range("B1").value = "Data 1"
    etc, etc,etc....
    End With

  4. #4

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    thank you very much

  5. #5

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    yeah, thanks

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