Reputation: 6050
I am exporting the contents of one excel file data to the other excel file by using the range excel object in a windows application.. while declaring the object, am getting the error like type excel object is not declared.. here is my code.
Dim excelApp As excelobject
'string filePath = "D:\Test.xls"
excelApp = New Excel.Application()
excelWorkBook = excelApp.Workbooks.Open(epath)
excelWorkSheet = (Excel.Worksheet)excelWorkBook.Worksheets.get_Item(1)
excelWorkSheet.Copy(Type.Missing, Type.Missing)
excelWorkSheet = excelApp.Workbooks[2].Sheets[1]
if (excelWorkBook != null)
excelWorkBook.Close()
End If
if (excelApp != null)
excelWorkBook = excelApp.Workbooks.Open("D:\Test-1.xls")
excelApp.Quit()
this.releaseObject(excelWorkSheet)
this.releaseObject(excelWorkBook)
this.releaseObject(excelApp)
End If
Upvotes: 0
Views: 894