-
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"
-
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