Dummy explanation to win32com needed

Darcy Mason darcymason at gmail.com
Wed Oct 22 20:46:51 EDT 2008


On Oct 22, 3:43 pm, korean_dave <davidrey... at gmail.com> wrote:
> Hi. I need a dummy's explanation to utilizing the win32com component
> to access Microsoft Excel.
>
> So far, I have this code.
>
>     import win32com.client
>     xl = win32com.client.Dispatch("Excel.Application")
>     xl.Visible = 1
>
>     workbook = xl.Workbooks.Open("C:\test.xls")
>
> Now, my question is, where do I find the snytax I can use to access
> such functions like workbook.ActiveSheet.Cells(1,1).Value etc...
>
> I need a reference to the API I can utilize.
>
> Where can I find this?
>
> Thanks guys,
> -Dave

I haven't used this in quite some time, but if I recall correctly, it
simply follows the object model as found in Excel Help | Visual Basic
Reference, or go into the Excel code editor (alt-F11)and use the
object browser. One thing to be aware of, IIRC, is that in VB you can
leave out some default names (like .Value, .Item for collections) but
these must be explicitly referenced when called using win32com.



More information about the Python-list mailing list