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
4
votes
1 answer

win32com having problems writing date value using python

I wrote a python script a year or so ago that has been working quite well since then. It writes some values I extract from an oracle database to an excel spreasheet using a search cursor from ArcGIS arcpy module and then I write to the excel…
Mike
  • 4,099
  • 17
  • 61
  • 83
4
votes
0 answers

Accessibility support for a Win32 control based on RichEdit

I have implemented custom Win32 control based on RichEdit. I insert custom OLE objects into the rich text using method 'InsertObject' of the IRichEditOle. Custom objects just show some text and some more additional functionality. This my control is…
4
votes
1 answer

win32com.client: AttributeError: wdHeaderFooterPrimary and AttributeError: wdAlignParagraphCenter

We prepare the following python script to display pictures in word tables. import matplotlib.pyplot as plt import pylab import win32com.client as win32 import os # Skip picture making parts #Generate word file #Create and formating wordapp =…
Chubaka
  • 2,933
  • 7
  • 43
  • 58
4
votes
2 answers

Pass keyboard input to a windows executable

I am creating a Python batch script for a piece of software that must run as a windows executable in C:\ The pipeline is almost set up. But the executable requires some keyboard entry before it starts. Before trying to pass keyboard entry it worked…
asmason
  • 75
  • 9
4
votes
2 answers

Qualcomm's QPST Automation Server in Python 2.7 using win32com module

Python newbie here. So, please excuse if this has been asked before in a different format. I am trying to replicate the following perl snippet in Python using the win32com module. This snippet is provided by Qualcomm for easier automation of their…
user3285807
  • 61
  • 1
  • 6
4
votes
2 answers

How to merge several Excel sheets from different files into one file

Each source file contains only one sheet. All I want is to combine these sheets into a single file. I suppose I'll have to use win32com. Does anyone know how? Update: the sheets to be combined have extensive conditional formatting that I'd like to…
Tian He
  • 272
  • 1
  • 5
  • 14
4
votes
2 answers

py2exe and win32com

Can py2exe create standalone executables even ones requiring the win32com package? I've googled / searched SO to no avail.
jldupont
  • 93,734
  • 56
  • 203
  • 318
4
votes
1 answer

Python and win32com.client seem to be missing methods, in particular SetSourceData

I'm working on using Python to automate some Excel data analysis. I have most of the basics down, but I can't seem to find any way to call SetSourceData or SeriesCollection successfully. I've read this post (and all the others) and found it hopeful,…
Robert Balicki
  • 1,583
  • 2
  • 16
  • 24
4
votes
4 answers

Access data in Excel - Reuter from python

I'm using Reuters integrated in Excel to retrieve market data. For task automation , I currently use VBA but now I want to switch to python. The package pyxll does not help much because the principle is the same as VBA (I need to be inside Excel and…
nam
  • 3,542
  • 9
  • 46
  • 68
4
votes
1 answer

In OnNotify what is the difference between returning TRUE or setting *pResult = TRUE

Given a notification handler BOOL CMyWindow::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { ....... If I process a particular notification. Should I return TRUE or set *pResult = TRUE? This is something that's bugged me for ages.
Joseph King
  • 5,089
  • 1
  • 30
  • 37
4
votes
2 answers

How to create a url shortcut by python

I want to create a shortcut by python pywin32, but the code doesnot work. the following is my code , I donnot know why i cannot create a shortcut by it ! Please help me check it, thanks for your help~ #-*- coding:utf-8 -*- import…
bspeng922
  • 115
  • 1
  • 1
  • 7
4
votes
0 answers

pandas dataframe to excel with win32 : numpy datatype error

I am trying to export a pandas dataframe to excel using win32. The export seems to work only when the dataframe does not include numpy datatypes. How can I convert numpy datatypes to their COM variant ? Here a reproducible example : import pandas…
user1043144
  • 2,680
  • 5
  • 29
  • 45
4
votes
1 answer

Cannot iterate VBA macros from Python

I am using VBA in conjunction with Python. I imported the module OS, and for working with excel - openpyxl. The problem occurs when it iterates the function for running the VBA macro from Excel. import random from openpyxl import…
Emkan
  • 188
  • 1
  • 7
4
votes
1 answer

MS Word r/w in python, Python-docx issue and win32com references?

Recently I'am experimenting with different API's for MS Word file management (writing for now). At this point I need just a simple writing python API. I tried win32com module which prove to be very robust with lack of examples for python online…
Domagoj
  • 1,674
  • 2
  • 16
  • 27
4
votes
3 answers

Python Makepy with Office 2013 (office 15)

I'm using python and excel with office 2010 and have no problems there. I used python's makepy module in order to bind to the txcel com objects. However, on a different computer I've installed office 2013 and when I launched makepy no excel option…
omer bach
  • 2,345
  • 5
  • 30
  • 46