Results 1 to 2 of 2

Thread: Populating an Excel sheet

  1. #1

    Thread Starter
    Hyperactive Member Dorothy's Avatar
    Join Date
    Feb 2001
    Posts
    310

    Question Populating an Excel sheet

    I have an xls file at "C:\test.xls". I need to populate the xls file with values of a string array.

    Help me out?

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    Just the same as in VB - add a reference to the excel object model.

    Dim a As New Excel.Application()
    Dim wb As Excel.Workbook
    Dim ws As Excel.Worksheet

    wb = a.Workbooks.Open("C:\book1.xls")

    ws = wb.Worksheets.Item(1)

    With ws
    'populate titles
    .Cells(1, 1).value = "Date"
    .Cells(1, 2).value = "Location"

    .Cells(2, 1).value = YOUR STRING VALUE
    .Cells(2, 2).value = YOUR STRING VALUE
    End With
    Wind and waves resolves all problems.

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