473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Dummy explanation to win32com needed

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
Oct 22 '08 #1
2 1652
On Oct 22, 3:43*pm, korean_dave <davidrey...@gmail.comwrote:
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.
Oct 23 '08 #2
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
Oct 23 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly...
3
by: RJ | last post by:
Hi, I've been going over the Quick Start to Client side COM and Python and many other sources, but cannot find an example that will get my com/ActiveX .ocx USB device driver imported. The Excel...
0
by: Paul McGuire | last post by:
Software versions: Python - 2.3.3 win32all extensions - build 163 OS- Win2000 SP4 I am having trouble in accessing a customer's proprietary COM type library. After running makepy against the...
4
by: wireless | last post by:
I've written code that dynamically builds an sql query based on various constraint possibilities. The problem is the code would have been very complex had I not come up with a dummy constraint...
2
by: Sibylle Koczian | last post by:
Hello, I've installed Python 2.4 and the win32 extensions, using administrator rights, under Windows XP in "C:\Programme". As this is a directory without spaces I didn't expect any problems. But...
1
by: SS Hares | last post by:
Hi, I'm encountering an issue where the InvokeTypes method is returning None and I'm unable to Dispatch a particular COM object from DMCoreAutomation.dll. Everything works fine except for method...
12
by: vithi | last post by:
Hi Any one tell me where I can get (or download) python modules win32com or win32com.client because I have to use "Dispatch" thanks
2
by: Ray | last post by:
Hi, I need to use cell's background color. when I record a macro from excel, it shows: Rows("7:7").Select With Selection.Interior .ColorIndex = 8 .Pattern = xlSolid
11
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.