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




Reply With Quote