Results 1 to 2 of 2

Thread: probs w/ VB to Excel

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2001
    Posts
    41

    probs w/ VB to Excel

    the following is the code i am using to test to see if i can get it to add info to excel but i cant seem to get it to work can someone help - i just want to for now take the word TEST and add it to excel later on i will expand and make it add what ever is in listbox and add it to excel THANKS ALOT

    Dim xlsWorkBook As Excel.Workbook
    Dim xlsWorkSheet As Excel.Worksheet
    Set xlsWorkBook = GetObject("D:\MoviePlayList VB\test.xls")
    Set xlsWorkSheet = xlsWorkBook.Worksheets("C")
    Print sheets2.Cells(1, 2) = "TEST"

  2. #2
    Lively Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    81
    Dim xlsWorkBook As Excel.Workbook
    Dim xlsWorkSheet As Excel.Worksheet
    Set xlsWorkBook = GetObject("D:\MoviePlayList VB\test.xls")
    Set xlsWorkSheet = xlsWorkBook.Worksheets("C")
    You are correct upto this

    After this, instead of using the below statement,
    Print sheets2.Cells(1, 2) = "TEST"

    U have to use
    xlsworksheet.cells(1,2).value = "test"

    Hope this helps u
    Pls reply ASAP.

    Luv...........Ravindran

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