Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Dummy explanation to win32com needed

Reply
Thread Tools

Dummy explanation to win32com needed

 
 
korean_dave
Guest
Posts: n/a
 
      10-22-2008
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
 
Reply With Quote
 
 
 
 
Darcy Mason
Guest
Posts: n/a
 
      10-23-2008
On Oct 22, 3:43*pm, korean_dave <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
Tim Golden
Guest
Posts: n/a
 
      10-23-2008
korean_dave 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")


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=sit...object%20model



TJG
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CONCEPT OF DAO IN J2EE --- EXPLANATION NEEDED soody Java 2 06-05-2007 08:35 AM
XSL help needed for dummy Gina_Marano XML 2 05-30-2007 11:59 PM
standalone in prolog: specs explanation needed VK XML 1 05-18-2006 10:43 PM
explanation needed on const pointers deepunayak@gmail.com C Programming 9 02-16-2006 10:31 PM
explanation needed for optical illusion in digital photo Eigenvector Digital Photography 27 08-02-2003 05:20 AM



Advertisments