473,803 Members | 4,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

documentation for win32com?

Is there anything better to read on how to use this module for working
with Office programs? This is not very heartening to read in the
official docs:
-----------------------
How do I know which objects are available?

Good question. This is hard! You need to use the documentation with the
products, or possibly a COM browser. Note however that COM browsers
typically rely on these objects registering themselves in certain ways,
and many objects to not do this. You are just expected to know.
-----------------------

Yeah, thanks...

So does this mean that the code can be different each time, or is there
still a pre-determined way to refer to things, such as opening Excel,
reading a spreadsheet and working with it, etc.? If so, where can I find
a list of those objects and methods?

Thanks.
May 23 '06 #1
4 4664
John Salerno wrote:
So does this mean that the code can be different each time, or is there
still a pre-determined way to refer to things, such as opening Excel,
reading a spreadsheet and working with it, etc.?
For a given version of Excel, there's a "pre-determinied way" of doing
those things. Different versions of Excel may do things the same way or
differently depending on what exactly you're trying to do.
If so, where can I find a list of those objects and methods?


In the documentation for the version of Excel you're using.

Ross Ridge

May 23 '06 #2
The Excel docs are your best bet. The examples they give
are all MS-specific languages like VB, but most translate
fairly easily to Python.

You can also run makepy on the Excel typelib, which will
generate a file with all the methods, events etc available
thru the Excel object model.

Also, searching this group and the pywin32 mailing list
for "excel.applicat ion" turns up a bunch of sample code.

hth
Roger
"John Salerno" <jo******@NOSPA Mgmail.com> wrote in message news:hQ******** **********@news .tufts.edu...
Is there anything better to read on how to use this module for working with Office programs? This is not very heartening to
read in the official docs:
-----------------------
How do I know which objects are available?

Good question. This is hard! You need to use the documentation with the products, or possibly a COM browser. Note however that
COM browsers typically rely on these objects registering themselves in certain ways, and many objects to not do this. You are
just expected to know.
-----------------------

Yeah, thanks...

So does this mean that the code can be different each time, or is there still a pre-determined way to refer to things, such as
opening Excel, reading a spreadsheet and working with it, etc.? If so, where can I find a list of those objects and methods?

Thanks.



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
May 24 '06 #3
Hi!
MS-Office-2007 beta2, can downloaded here :
http://www.microsoft.com/office/prev...etthebeta.mspx
(with a passport account).

Doc, for COM access, are include in the help-system.
@-salutations

MCI
May 24 '06 #4

Roger Upole wrote:
The Excel docs are your best bet. The examples they give
are all MS-specific languages like VB, but most translate
fairly easily to Python.

You can also run makepy on the Excel typelib, which will
generate a file with all the methods, events etc available
thru the Excel object model.

You should definately run makepy, it will be a great help, but there
are objects for which you can still not get any 'help' from your IDE's
autocompletion. ..
In those cases you'll just have to wing it, and indeed refer to the
Excel helpfiles for VBA methods/objects/etc.

Look at some samples on the web, and experiment a lot (using the
PythonWin IDE seems to work quite well for this kind of experimenting,
perhaps IDLE would also do it quite well. Due to the dynamic nature of
this kind of explorations, the pydev Eclipse plugin doesn't work well
for it).

Also, searching this group and the pywin32 mailing list
for "excel.applicat ion" turns up a bunch of sample code.

hth
Roger


Cheers,

--Tim

May 24 '06 #5

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

Similar topics

1
5199
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 remove old version (as well as the mx libraries I had installed). I then installed the new version as a user with the Administrator role. I know I'm technically not supposed to install to a directory with a space in the name, but it worked fine for...
3
7028
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 and Word examples run fine. win32com.client.Dispatch("Excel.Application") etc., but how does one know the ("<foo>.<bar>") to type in? Excel looks only vaguely like "Excel.Application" in the com browser.
0
1913
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 customer's typelib, I am still unable to create a typed object, getting the following Python traceback (I have to sanitize the customer's product, I have replaced it with XYZ):
2
7101
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 now I can't _use_ win32com as a normal user, because normal users can't write there: PythonWin 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32. Portions Copyright 1994-2004 Mark Hammond (mhammond@skippinet.com.au) -
3
6960
by: tyler.schlosser | last post by:
Hi there, I am trying to launch a program called AmiBroker using the command: AB = win32com.client.Dispatch("Broker.Application") However, I have a dual-core CPU and would like to launch two instances of AmiBroker. I know it is possible to run two instances simultaneously since it is easy to do manually by double-clicking the AmiBroker.exe file twice. However, when I write two lines of code like this:
12
130003
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
9306
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
7751
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 enabled me to the contacts at least list. I had to root around to discover CdoDefaultFolderContacts (though it was guessable; how could I enumerate win32com.client.constants?). I now want to work through the Contacts in Outlook patching in...
1
8218
by: korean_dave | last post by:
Hi. Where can i find the API for this extension? Sourceforge only has downloads. Python has stopped supporting the upkeep of the versions. Thanks.
4
3615
by: sterling | last post by:
I'm curious as to why the difference between IDLE and pythonWin when using win32com. opening an excel file, i've attempted to grab the chart information out of the file. commands like co = ChartObjects(1) works in pythonWin but doesn't work in IDLE. however, on both co = chartobjects(1) works just fine.
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10546
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.