Controlling Excel with win32com

A

Al Christians

I'm starting to test a python application that creates an Excel
workbook, then fills in values for some cells and formulas for other
cells. The formulas involve circular references, which will cause Excel
to take a little time to update and iterate through the successive
approximations of finding a solution to the formulas. (The system
should converge pretty well -- no bad behavior expected.)

Since Excel runs as a com server in another window, is there anything
that the python side of the win32com connection has to do to make sure
that it is not calling Excel while Excel is busy recalculating or
otherwise processing a previous request? Are the assignments to the
cell Value and Formula properties synchronized for me somewhere?

I think that I've noticed a run-sometimes/crash-sometimes behavior in
this program, but I'm so clueless about what's going on behind the
scenes with com that I haven't really tied it down. It seemed to get
better behaved when I turned off automatic recalculation, but that does
not seem to me to be a guarantee that there will be no timing problems
if the messages are not queued somewhere and if there is not some other
mechanism to keep things synchronized.

What works best?

TIA


Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top