|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Excel fileHello,
I need to open an excel Workboot from an existing excel file, but I get the following error: Old format or invalid type library Here is my code: Dim oExcel As Excel.Application oExcel = New Excel.Application Dim oWorkbook As Excel.Workbook oWorkbook = oExcel.Workbooks.Open(Filename:=Request.ServerVariables("APPL_PHYSICAL_PATH") & "otrapruebamas.xls") 'This line generates the exception Dim x As String = oWorkbook.Worksheets(1).Range("A1").Value I need help, thanks!! I'd check and make sure the reference you have to Excel in your solution is
the same version you're trying to open. Also, does the result of Request.ServerVariables("APPL_PHYSICAL_PATH") have a slash on the end? Robin S. -------------------------- Show quote "jessi" <ama***@cyc.es> wrote in message news:%23HMFD6PSHHA.4832@TK2MSFTNGP04.phx.gbl... > > Hello, > > I need to open an excel Workboot from an existing excel file, but I get > the following error: > > Old format or invalid type library > > Here is my code: > > Dim oExcel As Excel.Application > oExcel = New Excel.Application > Dim oWorkbook As Excel.Workbook > oWorkbook = > oExcel.Workbooks.Open(Filename:=Request.ServerVariables("APPL_PHYSICAL_PATH") > & "otrapruebamas.xls") 'This line generates the exception > Dim x As String = oWorkbook.Worksheets(1).Range("A1").Value > > I need help, thanks!! > > |
|||||||||||||||||||||||