Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2003 + Solver + C#
Sorry for the cross post but I need an answer to this ASAP and wasn't sure which newsgroup is the most relevant since this problem covers a number of areas. Problem: How to automate Excel 2003 with C# and use the Excel Solver add-in. I've setup a spreadsheet that has a number of cells within it that I must populate through automation, I then have a macro that performs a Solver function on these cells and produces an answer which I then must retrieve. The spreadsheet, Solver and the macro all work fine when opened independently not using automation with C#. Further the cells are populated and the macro is called no problem with automation. The problem comes when the C# program calls the Excel macro that calls the Solver function, I get the infamous "Solver: An unexpected internal error occurred, or available memory was exhausted." error message. This happens every the time. HOWEVER if I pause the C# program (with Excel visible) just before calling the macro, open the Tools-Solver dialogue and immediately close it without performing a Solve, and then let the C# program perform the macro it works fine. So it looks like Solver may not be getting initialised properly. One thing to note, this works fine using VB6 and Excel + Solver, we've only hit problems with .Net and Excel + Solver. Anyone with any ideas, anyone from the Office2003 + .Net interop? We'll have to rewrite this functionality using VB if we cannot resolve this, bit of a backward step! Many thanks David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 + Solver | Excel Worksheet Functions | |||
Excel 2003 - Calculation production schedule using solver | Excel Worksheet Functions | |||
how do you use solver in excel 2003 | Excel Discussion (Misc queries) | |||
How can I install Excel Solver without the Office 2003 disk? | Excel Worksheet Functions | |||
Solver Adds in Microsoft Edition 2003 (student version) | New Users to Excel |