How to value in a excel from particular range and paste it to excel into a range using vb script
Getting error on this
Dim excel As Microsoft.Office.Interop.Excel.Application
Dim excel1 As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
Dim wb1 As Microsoft.Office.Interop.Excel.Workbook
Dim ws1 As Microsoft.Office.Interop.Excel.Worksheet
Dim rng As Microsoft.Office.Interop.Excel.Range
' Initialize Excel objects
excel = New Microsoft.Office.Interop.Excel.Application
wb = excel.Workbooks.Open(Filename)
excel.Visible = False
ws = CType(wb.Sheets(TargetSheet), Microsoft.Office.Interop.Excel.Worksheet)
excel1 = New Microsoft.Office.Interop.Excel.Application
wb1 = excel.Workbooks.Open(Filename1)
excel.Visible = False
ws1 = CType(wb.Sheets(TargetSheet1), Microsoft.Office.Interop.Excel.Worksheet)
ws1.Range("A4","T"+ws.Rows.Count.ToString).value = ws.Range("A2","T"+ws.Rows.Count.ToString)
' Save and close the workbook
wb.Save()
wb.Close()
wb1.Save()
wb1.Close()