Which way is best to execute a Python script in Excel?

Karim kliateni at gmail.com
Thu Jul 5 09:26:33 CEST 2012

Le 05/07/2012 09:22, Maurizio Spadaccino a écrit :
> Hi all
> I'm new to Python but soon after a few days of studying its features I 
> find it my favourite mean of programming scripts to allow for data 
> storing and mining. My idea would be to inplement python scripts from 
> inside an excel sheet that would store and fetch data from a Mysql 
> database. So i need the script to be launched, say, by pressing a 
> button in excel and, for instance, retrieve immediately data from the 
> mysql table. For what I found in the net, it seems there are three 
> ways to control python from excel:
> 1) run my python script via shell using the Run command in VBA, which 
> seems to me the easiest (but maybe slower?) way;
> 2) creating a COM server, for which I need more training since it 
> doesnt appear that easy;
> 3) via Microsoft Script Control, for which I saw some example around 
> where It looks like I can 'simulate' a python shell via the 
> 'executeStatement' command.
> What would you suggest would be the more performing way to achieve my 
> goals as described above?
> Thanks for you help
> Maurizio
> -- 
> Maurizio
> www.mauriziospadaccino.com <http://www.mauriziospadaccino.com>
> ---------------
> If you can avoid printing this e-mail, you are only doing good for our 
> planet.
Look at PyUNO from OpenOffice very large API:

I use to create all my documention (Excell, Writer, etc...) on this API.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120705/be3805d4/attachment.html>

More information about the Python-list mailing list