I'm trying to run a Excel macro, which uses SOLVER.XLA Add-In, in VB.NET application. When the macro is executed I get the following error message
"Solver: An unexpected internal error occured, or available memeory was exhausted"
Any suggestions whats causing this error and how to debug it :confused:
Also, I get the following exception message when executing all the macros from the excel sheet
"Exception from HRESULT: 0x800xxxxx"
I'm not sure about the source of this either.
Can anyone pls help me with these errors
My code for reference:
Dim oExcel As Excel.Application
Dim oBook As Excel.Workbook
Dim oBooks As Excel.Workbooks
Dim oSheets As Excel.Sheets
Dim oSheet As Excel.Worksheet
Try
oExcel = CreateObject("Excel.Application")
oBooks = oExcel.Workbooks
oBook = oBooks.Open("C:\Inetpub\wwwroot\PrePackOptimizer\Data Source\book2.xls")
oExcel.AddIns.Add("C:\Program Files\Microsoft Office\OFFICE11\Library\SOLVER\SOLVER.XLA")
oExcel.DisplayAlerts = True
oExcel.Run("Module1.SOLVER")
P.s.: The macro and the SOLVER runs perfectly when run from the EXCEL file.