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
0
votes
0 answers

Using win32com and python 3.7.2 64bit to connect to MS Excel 2016 32bit

I would like to know, if it is possible to use win32com library (win32com.client and others) to connect to MS Excell with Python in following configuration: MS Excel 2016 32bit Python 3.7.4 64bit Win10 64bit win32com (I dont know how its…
Tomáš Kruliš
  • 167
  • 2
  • 9
0
votes
0 answers

Getting file exists overwrite alert when trying to refresh and save .xlsm file via python even with DisplayAlerts set to False

I am trying to refresh a macro enabled excel file through a python script. I have used win32com.client package for launching an excel instance and refreshing the file and trying to save it. I have also set DisplayAlerts = False. I am getting an…
Asish
  • 1
0
votes
1 answer

pywin32com.client throwing attribute errors

I am trying to open excel application using win32com. Everything I tried so far gives me attribute error. So far I tried win32com.client.Dispatch('Excel.Application') win32com.client.DispatchEx('Excel…
Atiqul Islam
  • 83
  • 1
  • 1
  • 4
0
votes
1 answer

Sending Email per win32 from python: how to exclude somebody from the email list

I have a short question. My python program sends automatically emails to the members of some email list. I use the following syntax: import win32com.client as win32 outlook = win32.Dispatch('outlook.application') mail =…
Denis
  • 99
  • 10
0
votes
2 answers

Not getting all InfoMessage Events with Python and win32com

I am currently trying to get the percentage complete messages that are returned by the InfoMessage event from ADO (and a SQL server) when running the BACKUP command. (See my previous question for more details). I have managed to connect to the SQL…
thomas
  • 949
  • 6
  • 20
0
votes
0 answers

Win32COM code wont replace excel strings in a formula reference

This code copies the first sheet of an excel workbook that already has formulas into a new book. For some reason, when you move the sheet, the formulas still reference the old book (in the example below-- Book1). To get around this, you can find…
Tug01519
  • 13
  • 4
0
votes
1 answer

How to use Win32com to Find and Replace. My code wont execute Replace

New to Python-- My code wont execute Find and Replace after moving the Sheet. The goal is to bring a new sheet with formulas, then Find and Replace the reference, in the formulas from the 1st book. This will allow the formulas to be live in the…
Tug01519
  • 13
  • 4
0
votes
0 answers

How to overcome the 65536 Excel row limit when using win32 in Python and Excel 2010

I can create an Excel 2010 pivot table using an input worksheet of greater than 65536 rows. When I try this in Python using win32com.client and 'Excel.Application' this fails with the message Exception: Type mismatch. This was still a cryptic…
hubris
  • 1
0
votes
1 answer

Python: File path's hyperlink is opening in browser, instead of in file explorer

I'm using following code to send an email to a team which contains hyperlink to the file, and hyperlink is path on network drive. import win32com.client as win32 Path = '\\rsc.allnd.com\qdrive\shared' mail = outlook.CreateItem(0) mail.To =…
Scarface
  • 359
  • 2
  • 13
0
votes
1 answer

How to change attribute to excel line shape converting vba script in win32com

I would like to convert a VBA script in win32com code in order to select and modify property of line shape in excel worksheet. I am able to select the line (I see the line selected in excel worksheet) but I'm not able to change the property. Could…
Blue Bird
  • 5
  • 2
0
votes
1 answer

Access VBA <-win32 com server-> python script

I've copied the example code https://inneka.com/programming/vba/moving-numpy-arrays-from-vba-to-python-and-back/ (solution 2) to a VBA Sub and a python script. import sys, os, win32api, win32com.server.localserver, win32com.server.register import…
incognito
  • 199
  • 3
  • 16
0
votes
2 answers

How can I export VBA code to text from de modules?

I'm trying to map all VBA codes I've in some excel in the office. In my job, we have more than two hundred excel files, with a lot of macro in each. How can I extract the code text of some module? I've see something like workbook =…
de_python
  • 107
  • 1
  • 6
0
votes
1 answer

Change Font for Chinese Characters in VBA

I am trying to write a helper script for a colleague that will automatically open up all .doc(x) files in a directory, find any and all chinese characters, set their Font, save and close. I already have a working version of this script. The file…
tst
  • 371
  • 1
  • 11
0
votes
1 answer

All slide master placeholders default to type 14

I am playing around with using win32com to create power points programmatically. I have a issue when snooping around in the slide master. Open a power point, go to Home -> Editing -> Select -> Selection Pane Then do View -> Slide Master I deleted…
Melendowski
  • 404
  • 4
  • 16
0
votes
2 answers

Find specific mail in Outlook by title

I am trying to create a code that will find letters in my mailbox using Subject field (according Outlook rules this letters will be located in folder 'TODO' for example). That's what I have for now: import win32com.client outlook =…
1 2 3
99
100