1,908 questions
1
vote
1
answer
79
views
JNA CoCreateInstance returns S_OK but ShellLink/IShellLinkW fails, COM pointer is non-null but object unusable
I'm making a Java app that scans the Windows Recent Files folder and resolves .lnk shorcuts to their actual file paths. I'm doing so using JNA the JNA API and simulating IShellLinkW and IPersistFile.
...
0
votes
1
answer
121
views
How to fix this Python script error with win32com outlook app
I'm following a video on youtube on creating a new mail with python. But I'm getting error. Am I missing something? My goal is to create a new mail and insert images from a folder into it. The first ...
1
vote
1
answer
109
views
Python Win32Com: How do I open a password-protected Powerpoint?
I tried to use the below code to open a password-protected ppt, but I got error:
TypeError: Open() got an unexpected keyword argument 'Password'
Is it possible to use Win32Com to open a password-...
1
vote
1
answer
112
views
OneNote COM Application Interface events with Python
I would like to use the Python win32com library (part of pywin32) to receive events from the local OneNote Application Interface (as documented here). Note this question does NOT relate to the newer ...
1
vote
1
answer
108
views
Copy pasting Excel range to Outlook email - GetInspector Error
I don't recall making any changes to the code, but now my helper function for sending emails gets the following error:
com_error: (-2147352567, 'Exception occurred.', (4096, 'Microsoft Outlook', 'The ...
0
votes
1
answer
97
views
How can I get intellisense working in vsvode for python win32com objects?
I've recently started doing a bit of Python coding, using VS Code, to create macros / applications for CATIA (using it's COM interface). In CATIA itself, I can use the included VBA editor to write ...
0
votes
0
answers
53
views
Can you override the "This file is in use" message from excel when interacting with it from vscode (python)
I am attempting to connect python to excel, using VSCode, a pySide6 GUI and xlwings and win32com. Whilst I can manage to update an excel document when it is closed, I cannot seem to be able to do live ...
1
vote
0
answers
44
views
Projected surface area of CatiaV5 part (Using silhouette)
I've been trying to figure out how to access silhouettes for CatiaV5 (GSD) API in python for a few days now but i've not been able to figure it out (To extract the projected surface area of a solid ...
1
vote
1
answer
153
views
Saving Excel files as PDF using win32com python library and getting error
I'm trying to run a script that reads a txt file that contains a list of file paths to Excel files, and save each one as a pdf in a specified directory. I can get it to read the txt file and parse ...
2
votes
1
answer
131
views
win32com pywintypes.datetime in Pandas DataFrame
I am using win32com to pull some data out of large excel files and am running into an issue with pywintypes.datetime and subsequent Pandas DataFrame creation. DataBody = tbl.DataBodyRange() gives a ...
0
votes
2
answers
166
views
How to access "Groups" folder in Outlook using pywin32
I am trying to read emails of a particular mail group using pywin32 which, is showing under "Groups" of my outlook mail (shown in screenshot). I am able to access all the folders under my ...
0
votes
0
answers
27
views
Injecting Multi-Colored Text into an Existing PSD Text Layer?
I have a PSD that already contains a single text layer, and I want to inject a block of text into that layer where different words or phrases are each rendered in their own color (e.g. some words blue,...
2
votes
1
answer
29
views
Issues with printing docx using win32com pyhon
Im running a simple app in python that is supposed to print a set number of pages from a document im working on. The document is 8 pages long but using
doc = word.Documents.Open(abs_docx_path)
doc....
0
votes
0
answers
55
views
Unblock file programmatically that is created via win32com.client in Python on Windows
I am creating programmatically a shortcut using win32com.client.
import win32com.client
shell = win32com.client.Dispatch("WScript.Shell")
shortcut = shell.CreateShortCut("foo.lnk")...
0
votes
0
answers
117
views
No module named 'pywintypes'; seemingly problem with virtual environment
I've read through all the relevant posts to this question, but sadly most remain unanswered, or don't seem to apply to my specific situation.
I want to use the win32com module, which is part of the ...
0
votes
1
answer
111
views
HTMLBody does not compile in Python when generating an Outlook email
I am writing a Python module to generate an outlook e-mail with an attachment using win32com. All works fine except for the formatting of the HTMLBody. As far as I have researched, it is
impossible to ...
0
votes
0
answers
20
views
Discrepancy in Win32com Word Application output and GUI output
I am using win32com to extract a Word document Flesch score directly instead of through the editor, because I would like to automate and store in bulk all the Flesch scores for multiple Word documents....
0
votes
0
answers
45
views
passing custom variable type to COM object with python
I am trying to create a program in python to pull file histories from a SolidWorks PDM Professional vault, and the method call for retrieving a files history requires passing an empty array of type '...
0
votes
0
answers
89
views
Python flask API to convert DOCX to PDF
I created a Python Flask API to convert DOCX files to PDF. It works perfectly when I start it manually via the command line. However, I’d like to turn it into a Windows service so that it can start ...
0
votes
0
answers
36
views
Error received when CC recipients are added in win32com using python
I want to send automated mails from my outlook to some email addresses using python win32com.
This is the code I am using -
def Emailer(text, subject, recipient):
import win32com.client as win32
...
2
votes
0
answers
379
views
PyWin32 throws "pywintypes com_error call was rejected" error, but only when NOT running from CMD
System setups:
Development PC: Win 10,Python 3.7.7, PyInstaller 5.3.12
Deployment PC: Win11, No Python installled
I've made a CLI python script (running from Windows CMD) with the following simple ...
0
votes
1
answer
56
views
Duplicates in outlook GAL (python)
Would anyone be able to help me with this issue? I'm making an App that looks in a GAL (global address list) in Outlook and finds the EX-user and stuff, I have that working and all but when I am ...
1
vote
1
answer
75
views
Python script to generate powerdesigner reports for all open models within a workspace
I am trying to automate the creation of powerdesigner data model reports on multiple physical models in an active workspace using Python- more using the specifically the win32com module. I'm fairly ...
0
votes
1
answer
333
views
How to send an email using python which is triggered through a DevOps pipeline
Using the win32com.client as win32 package in python, I have been able to successfully send emails to my colleagues mailboxes in Outlook, which is roughly set up as below:
import win32com.client as ...
1
vote
0
answers
137
views
Using IUnknown-derived interface in python / pywin32
In short: I'm trying to call a method on in IUknown-based interface. I have some parts, but they don't connect.
Situation:
o1 = win32com.client.Dispatch("SomeProgId")
o2 = o1.SubObject
The ...
0
votes
1
answer
66
views
Reading and downloading email attachments using win32com with one or more mail boxes
How can I add another mailbox to the below code?
import win32com.client
import os
from datetime import datetime, timedelta
outlook = win32com.client.Dispatch('outlook.application')
mapi = outlook....
2
votes
0
answers
89
views
Python cannot open Excel instance on windows server when remote connection to admin account is disconnected
I have a NodeJS application/website running on a Windows Server. This application is used as a GUI to trigger Python scripts. The python scripts open up excel instances and perform some ...
1
vote
0
answers
43
views
How to get PivotFields AutoShow method to work in Python using win32?
I'm working on automating an Excel file using Python's win32com.client library. My goal is to create an Excel file that will look and function as if someone had manually done all the work within Excel....
1
vote
1
answer
100
views
Resize the image in Power point using Python
I am copying a Excel chart and pasting it into a PowerPoint slide.
After pasting the chart I want resize the chart which is pasted in image format.
Kindly help
import win32com.client
# Grab the ...
0
votes
0
answers
34
views
Python use win32com connect windows to change windows password
I successfully connected to windows remotely using the win32com module. But I don't know how to change the account password through the connection.
I tried to create a process using Win32_Process's ...
0
votes
2
answers
537
views
Python obtain latest email from a sender using win32com.client
Trying to obtain the last email sent by a sender in outlook so I can download an attachment.
The issue I have is that the date the email was sent is not consistently sent every day so using something ...
0
votes
0
answers
116
views
python calls excel and run VBA macro, InsertPictureInCell function not immediately available
I am workin on a python function to insert pictures into excel cells "In Cell Mode".
The approach is using win32com package to start Excel create an excel file then run VBA codes.
I create a ...
1
vote
0
answers
56
views
How do I make variable aware of the output of gencache.EnsureModule?
workaround In the end I just copied the make_py output to my project and imported the entry-point class.
How do I make win32com.client.Dispatch(APPID) aware there is a gencached version?
Consider the ...
0
votes
1
answer
70
views
Win32com Word: Paragraphs Overwriting Each Other
I am trying to use win32com to generate this document:
Here is my code:
import win32com.client
word_app = win32com.client.Dispatch("Word.Application")
word_app.Visible = True
doc = ...
0
votes
0
answers
95
views
Error with an <empty> cell value in UniSim's spreadsheet connection with python via win32com.client
I'm trying to make a connection between python and UniSim Design, using jupyter-notebook. But I'm stucked with an error. The error follows below:
C:\ProgramData\Anaconda3\lib\site-packages\win32com\...
1
vote
1
answer
658
views
Setting Sensitivity Label for Excel Using Win32Com (Python)
I'm working on creating some scripts for our team to use with some new sensitivity labels that were recently implemented. I ultimately need a script that will get the current classification, and a ...
1
vote
1
answer
232
views
pywintypes.com_error when using getCellValue in SAP GUI Scripting with Python
I'm working on a Python script that interacts with SAP GUI using the win32com.client module. My goal is to retrieve a specific cell value from a table within SAP. However, I'm encountering an error ...
0
votes
0
answers
317
views
Error When Attempting to Import Dispatch from win32com.client
I'm trying to get PyXLL installed and am trying to take the preliminary step of calling into excel from python using win32 COM API.
From an Anaconda Prompt, with ipython, I type
from win32com.client ...
0
votes
2
answers
108
views
Outlook using python win32com reading only email till a specific date and nothing after that
Below is my Python code using win32com to read emails from a particular folder.
from logging import root
import os
import win32com.client
from datetime import datetime, timedelta
import zipfile
...
0
votes
0
answers
35
views
Excel Formula insert via Python -> @ added in front of references [duplicate]
no matter what I am trying everything I do results in Excel adding an @ in front of the "Target!..." which destroys the formula. I am using the win32com Module and would like to keep it that ...
1
vote
0
answers
48
views
How to open Outlook, open an email, and click on download button?
I use a batch file to run to open and close Outlook. After opening, how to open an email, and click on the download button using python 'import win32com.client' library? any suggestions?
I was able ...
-1
votes
1
answer
850
views
How to register voice for TTS in windows 11?
I have some troubles to use 2 additional voices, in my case i try to use Pablo (Spanish - Spain) and George (English - GB). I develop a app in python/Django, from the front i sent a JSON with the ...
0
votes
0
answers
42
views
win32com Excel terminating python program out of nowhere
I'm using a library called Excel2Image in order to take a sheet range in excel and save it as a video. This library uses win32com in order to get an excel application.
Inside of my main program, ...
0
votes
1
answer
73
views
Excel Ungrouping data
I am trying to ungroup the data in excel file.
I am not aware of row no which have been grouped.
When I click on 2 on top of file data gets ungrouped.
Is there a way I could do it using python.
I ...
1
vote
0
answers
58
views
Windows OS: Win32_PerfRawData_PerfProc_Process Virtual Memory is not matching with resource monitor's Commit Memory
I am trying to pull the Process metrics using Win32_PerfRawData_PerfProc_Process as documented at https://learn.microsoft.com/en-us/previous-versions/aa394323(v=vs.85)
From the document, VirtualBytes ...
2
votes
1
answer
236
views
How can I determine whether a Word document has a password?
I am trying to read word documents using Python. However, I am stuck in places where the document is password protected, as I do not have the password for the file(s).
How can I detect if the file has ...
1
vote
1
answer
637
views
(4096, 'Microsoft Outlook', 'The operation failed.', None, 0, -2147287037) error when saving an email to my local machine
I am trying to download some emails from my outlook folder to my local machine as .msg files using the following code.
messages = source_folder.Items
for message in messages:
# Estimate the size ...
0
votes
0
answers
250
views
DLL load failed: The specified module could not be found , win32com.client python library
when I import the win32com.client module i get this error
DLL load failed: The specified module could not be found
the line producing the error is :
\venv\lib\site-packages\win32\lib\pywintypes.py ...
0
votes
0
answers
362
views
Python and SAP GUI Scripting Error : pywintypes.com_error: (-2147221020, 'Invalid syntax', None, None)
I'm trying to write a automation script that does task on SAP. For this I'm using Python and win32com package, I'm getting the following error when I try to connect to SAP.
Traceback (most recent call ...
0
votes
1
answer
307
views
UnProtect DOC and DOCX using WIN32COM with Python
I´m trying to unprotect a word document file using win32com but the code below run without error and not unprotect.
I did some searches here and I have tried some variations with this code but no ...