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("Exce l.Application")
xl.Visible = 1
workbook = xl.Workbooks.Op en("C:\test.xls ")
Now, my question is, where do I find the snytax I can use to access
such functions like workbook.Active Sheet.Cells(1,1 ).Value etc...
I need a reference to the API I can utilize.
Where can I find this?
Thanks guys,
-Dave 2 1674
On Oct 22, 3:43*pm, korean_dave <davidrey...@gm ail.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("Exce l.Application")
* * xl.Visible = 1
* * workbook = xl.Workbooks.Op en("C:\test.xls ")
Now, my question is, where do I find the snytax I can use to access
such functions like workbook.Active Sheet.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.
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("Exce l.Application")
xl.Visible = 1
workbook = xl.Workbooks.Op en("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.Active Sheet.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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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.
|
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):
|
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 as a kind of place holder in the statement.
To avoid complex logic that determines if there was another constraint
before any other constraint and hence the need to add, say, AND or
not, I came up with a dummy constraint so that every subsequent...
|
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) -
| |
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
GetItemFields.
Using Python 2.4.2, pywin32 build 209.
Here is some example code (I can provide full source code if needed):
|
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
|
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
|
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...
|
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,...
|
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...
| |
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,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |