How to run Excel Solver function from Python

Aaron aaron.smgoh at gmail.com
Sat Sep 18 08:17:49 EDT 2004


I am trying to write a Python script file which analyses data in an
iterative manner.  During each iteration, I wish to utilise the Solver
function in Excel to perform some constrained, non-linear fitting to
the data.  I have a VBA macro which runs the Solver, and am using
self.xlapp = win32com.client.dynamic.Dispatch("Excel.Application")
.
.
.
self.xlapp.run(macro)

I am using the Python script to interface with another software called
ABAQUS and am executing the script through the ABAQUS Python
interpreter (which is Python 2.0).  Howvever, when I run the script I
get the error

'Solver : An unexpected internal error has occurred, or available
memory was exhausted'

Could anyone please provide some explanation to this problem?  The
macro and Solver run fine if I don't call from the Python script. 
Thank you and any help is much appreciated.



More information about the Python-list mailing list