BASIC vs Python

Jan Dries jan.dries at dcube-resource.be
Sat Dec 18 15:06:31 CET 2004


Michael Hoffman wrote:
> Gregor Horvath wrote:
> 
>  > Or make any given standard python object accessible from MS Excel in 2
>  > minutes.
> 
> from win32com.client import Dispatch
> 
> xlApp = Dispatch("Excel.Application")
> xlApp.Visible = 1
> xlApp.Workbooks.Add()
> xlApp.ActiveSheet.Cells(1,1).Value = 'Python Rules!'
> xlApp.ActiveWorkbook.ActiveSheet.Cells(1,2).Value = 'Python Rules 2!'
> xlApp.ActiveWorkbook.Close(SaveChanges=0)
> xlApp.Quit()
> del xlApp
> 
> (stolen from <http://www.markcarter.me.uk/computing/python/excel.html>)

Nice, but not really what the OP asked for. You make Excel accessible 
from Python, instead of the other way round.

Regards,
Jan



More information about the Python-list mailing list