Questions tagged [win32com]

win32com is a Python module to interact with Windows COM components. It is part of the Python for Win32 (pywin32) project by mhammond.

win32com is a Python module to interact with windows COM components. It is part of the Python for Win32 (pywin32) extensions project by mhammond, which provides access to many of the Windows APIs from Python.

The Python COM package can be used to interface to almost any COM program (such as the MS-Office suite), write servers that can be hosted by any COM client (such as Visual Basic or C++), and has even been used to provide the core ActiveX Scripting Support.

1868 questions
8
votes
2 answers

Accessing enumeration constants in Excel COM using Python and win32com

I'm using python 2.7 win32com module to load an MS Excel worksheet from Python: book = xlApp.Workbooks.Open("myFile.xls") sheet = book.Sheets(1) Many methods and properties of Range, Worksheet etc use enumerations like XlDirection,…
Oliver
  • 27,510
  • 9
  • 72
  • 103
8
votes
1 answer

Python win32com don't know name of module

I was looking for a python Zune(The windows media thing) api, when I looked at the COM browser in pythonwin. I found something called ZuneWmdu Type Library (1.0). I used makepy on that lib, it generated a…
Azeirah
  • 6,176
  • 6
  • 25
  • 44
8
votes
1 answer

How can I use Microsoft Word's spelling/grammar checker programmatically?

I want to process a medium to large number of text snippets using a spelling/grammar checker to get a rough approximation and ranking of their "quality." Speed is not really of concern either, so I think the easiest way is to write a script that…
Andrew Keeton
  • 22,195
  • 6
  • 45
  • 72
8
votes
1 answer

win32com.client error

When using win32com, something puzzled my. >>> import win32com >>> w=win32com.client.Dispatch('Word.Application') Traceback (most recent call last): File "", line 1, in
Wilson Cao
  • 81
  • 1
  • 1
  • 3
7
votes
3 answers

How to provide image data for embedded web control in C++

In my C++ app I'm embedding (via COM) a web browser (Internet Explorer) control (CLSID_WebBrowser). I can display my own html in that control by using IHTMLDocument2::write() method but if the html has element, it's not…
Krzysztof Kowalczyk
  • 3,513
  • 28
  • 28
7
votes
2 answers

Most efficient way to select all and copy in Windows

I've a script that scrapes data from a third party program. Currently I'm using emulated keyboard strokes to select and copy data: import win32com.client shell =…
jjjayn
  • 555
  • 5
  • 10
  • 19
7
votes
3 answers

win32com and SAP-GUI

My SAP-GUI has Scripting installed and Scripting is enabled. Like in this screenshot: In this Introduction to SAP GUI Scripting in "Step 2: Setup your SAP System" you need to call RZ11. I don't have permissions to call RZ11. Is there a way to…
guettli
  • 25,042
  • 81
  • 346
  • 663
7
votes
2 answers

Accessing webcam via DirectShow using COM with Python

I want to get low level access to webcam properties using DirectShow's IAMVideoProcAmp. There are several Python modules )pywin32, pywintypes, comtypes, win32com, pythoncom) that are used in this context and they seem to be related somehow. But I…
Joe
  • 6,758
  • 2
  • 26
  • 47
7
votes
2 answers

Error while converting from xls to xlsx using win32com. This program throws error if i work with other excel sheet

import pandas as pd import os import win32com.client import win32com.client.gencache fname = "C:\\Users\\prashanth\\Desktop\\student.xls" excel = win32com.client.gencache.EnsureDispatch('Excel.Application') wb =…
john
  • 119
  • 1
  • 8
7
votes
1 answer

Python Win32Com & Excel.Application Failing to Save on Scheduler

I am having an issue with using win32com and Task Scheduler. An Excel File save operation is not taking place despite other aspects of the script performing successfully. This is being run on an automation machine; there is no active login session.…
MavenACTG
  • 173
  • 9
7
votes
0 answers

Extract Header and Table text from a .docx file

I'm trying to extract page and header data from a docx file. The file is several hundred pages, each with a table and a header. The header has pertinent information that needs to be paired with each table. I'm able to extract the header and table…
user2682863
  • 3,097
  • 1
  • 24
  • 38
7
votes
1 answer

why does this script not work with threading python

so i've been trying to ifnd a way to access task manager. I've tried a few methods including the wmi module and the windows tasklist but neither suit my need. wmi is way too slow and tasklist becomes too slow when i access it multiple times…
J leong
  • 285
  • 5
  • 13
7
votes
1 answer

Outlook 2013 display HTML code instead of actual Data

I am using win32com.client , python 2.7.x and outlook 2013 on windows platform. I need to post contents of a HTML file to the body of outlook message. I followed the posts here ,here and here about how to save excel as HTML and paste data within…
Anil_M
  • 10,893
  • 6
  • 47
  • 74
7
votes
3 answers

Update the TOC (table of content) of MS Word .docx documents with Python

I use the python package "python-docx" to modify the structure amd content of MS word .docx documents. The package lacks the possibility to update the TOC (table of content) [Python: Create a "Table Of Contents" with python-docx/lxml. Are there…
thinwybk
  • 4,193
  • 2
  • 40
  • 76
7
votes
3 answers

Load Excel add-in using win32com from Python

I've seen from various questions on here that if an instance of Excel is opened from Python using: xl = win32com.client.gencache.EnsureDispatch('Excel.Application') xl.Visible = True wb = xl.Workbooks.Open('Test.xlsx') Then it does not load the…
Ben
  • 1,638
  • 2
  • 14
  • 21