Dummy explanation to win32com needed

K

korean_dave

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
 
D

Darcy Mason

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.
 
T

Tim Golden

korean_dave said:
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")

Well, for a start, you want to be raw-stringing that filename.
(And, possibly, putting it somewhere other than the root
of your c: drive ;) )

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...


All the pywin32 / win32com stuff is doing is wrapping the
Microsoft Excel Object Model. So, if you want to drive
Excel you have two tools: the Macro Recorder in Excel
itself; and Google:

http://www.google.co.uk/search?q=site:microsoft.com+excel object model



TJG
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top