errors on calling excel.sheets methods
-
Hello.. i wrote excel automation using vc++ 6.0 I had no problem.. now I'm converting all the c++ code into vb.net code and i am encountering problems whenever I call any function/ method of Excel.Sheets I got following message
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in PrintMSOF.exe Additional information: Exception from HRESULT: 0x800A03EC.
here How I open the file and get all sheets to printpreview I also tried shets = wBook.Worksheets to get the WorkSheets as I did in c++ but error tooooDim excelApp As Excel.Application Dim wBooks As Excel.Workbooks Dim wBook As Excel.Workbook Dim sheets As Excel.Sheets Dim shets As Excel.WorkSheets excelApp = CreateObject("Excel.Application") excelApp.Visible = True excelApp.UserControl = True wBooks = excelApp.Workbooks() wBook = wBooks.Open(filename) sheets = wBook.Worksheets sheets.Select() 'error error error error