Python in Excel

Afanasiy abelikov72 at hotmail.com
Mon Jul 7 22:39:54 CEST 2003


On Sat, 05 Jul 2003 02:48:15 +0100, hannibal <hannibal1812 at canada.com>
wrote:

>You can use Microsoft Script Control. If you have the win32 extensions 
>of python, you can use python in place of vb in this control
>
>-open the VBA script editor - In menus/Tools/References add Microsoft 
>Script Control
>-Make a new module and declare a new MsScriptControl.ScriptControl
>	Global sc as new MsScriptControl.ScriptControl
>-Initialize the language attibute with python - Note that you and users 
>of your document must have python and its win32 extensions installed. 
>Activestate python distribustion include it.
>You can put
>	sc.language="python"
>in the routine Workbook_Open()
>
>Now you can import python modules using ExecuteStatement method of the 
>control in vba and have results from python functions with eval method. 
>One interesting thing is that you can pass an object to the control with 
>AddObject method and have python manipulate it. And so on..

Thanks this is almost what I am looking for, very cool.
It would be nice not to have to do so much VB with it.

Is there any way around that? From my perspective, every Python function
used will be wrapped in a VB function which calls the Python function.

-AB




More information about the Python-list mailing list