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

How to resolve win32com error with xl.Visible=True?

Whenever I execute xl = win32com.client.DispatchEx("Excel.Application") xl.Visible = True together, I get an error. But the error doesn't appear if I execute line by line xl = win32com.client.DispatchEx("Excel.Application") then xl.Visible =…
Joe Chan
  • 133
  • 3
  • 11
0
votes
0 answers

Pywin32, write custom mail at outlook from word

I would like to write custom mail and mail contents are from word. At last line, I could see different mail format from original message. I don't understand why .format change format of original message. I want to keep format of original message. I…
easyWork
  • 1
  • 1
0
votes
0 answers

ModuleNotFoundError: No module named 'win32api' in IDLE on import win32com

When using Spyder, everything works without problem. I does not though in a virtual environment out of anaconda. I created a virtual environment and installed pywin32 with pip. I created a simple test script in Idle with just 1 line: import win32com…
RobertDL
  • 23
  • 1
  • 7
0
votes
1 answer

How to write a python script to read all subject headers of my Outlook... is it in a date range?

I'm trying to write a script in Python to read all the subject headers, in a range date... but it doesn't work! I have tried different solution to read emails in this range but I could not find a better option than restrict, I also tried to use…
Torbak
  • 1
  • 1
0
votes
0 answers

Running a Macro from my PERSONAL.XLSB on a different Excel file

I am using Python and PyCharm Community and am trying to automate some of my Excel work. I'm very new to Python. I have created a test of sorts to figure out before I run the code using my actual excel files. I want to: Open a specific excel…
0
votes
2 answers

Python Add CC Recipients in Reply through Outlook

I am searching an item in outlook through subject , want to do replay to all adding 3 ids in CC. Easily able to add more recipients in To but not in CC please help import…
Hietsh Kumar
  • 1,197
  • 9
  • 17
0
votes
1 answer

call vba function from python in already open excel file

I am trying to run vba macro from Python but the excel file which has macro is already open. So I want to not open it again as another instance. I have tried win32com code - however it reopens another instance of the same file and makes changes in…
0
votes
1 answer

How to sent email from a secondary Outlook account from its own outbox folder

My secondary outlook account does not appear in the list given by iterating over outlook.application CDispatch Session.Accounts. So, I'm using 'SentOnBehalfOfName' instead, as suggested by https://stackoverflow.com/a/57324426/6057650 to sent…
Khristhian
  • 26
  • 5
0
votes
1 answer

How to access a Lotus iNotes mailbox hosted only on a server with python?

I am trying to access a Lotus iNotes mailbox to download some attachments files via a python script. The mailbox is hosted only on the company server. I access it with an url which looks like : https://the_company_server.com/mail/db.nsf I read…
Dave
  • 33
  • 3
0
votes
1 answer

When you export large text to excel (Office 2007), no more than 8203 characters are exported to an excel cell

When you export large text to excel, no more than 8203 characters are exported to an excel cell. I think problem to VBA or win32com.client, if i use openpyxl lib - export correct. Error: (-2147352567, 'Ошибка.', (0, None, None, None, 0,…
0
votes
0 answers

Saving Email attachment - "Cannot save the attachment. Path does not exist." - pywin32

Objective of the program: I have a python script that searches my Outlook inbox for an email with a specific subject and if found will save the attachment on the email to a specific path. The script executes as expected when the path chosen to save…
Jkennedy559
  • 134
  • 1
  • 9
0
votes
1 answer

I am getting an error when trying to connect to Quickbooks using win32com.client.Dispatch() using ProgID "QBXMLRP2Lib.RequestProcessor2"

Based on the limited documentation I can found I have written the following code: import win32com.client import xml.etree.ElementTree as Et newSession = win32com.client.Dispatch("QBXMLRP2Lib.RequestProcessor2") but I am getting the following…
Zishe Schnitzler
  • 151
  • 2
  • 10
0
votes
2 answers

A com_error which doesn't allow me to read msg file

I could use win32client to read msg file yesterday, but all of a sudden it throws an error today while I'm running the same code against same file. Couldn't find the reason. There is not much explanation about the error message. There was an…
Billie_H
  • 69
  • 7
0
votes
1 answer

'[Errno 13]' Permission denied: Openpyxl and win32com conflict

I'm using win32com to run macros in excel and openpyxl to modify cell values. In the process of debugging, I attempted to create a simplified version of existing code but still ran into the same [Errno 13] Permission…
0
votes
1 answer

Using win32.com to copy excel worksheet throws Microsoft Excel copy paste error

When I use win32.com to open an excel file and paste the sheet into another excel file i get a copy paste error. import win32com.client import os excel = win32com.client.Dispatch("Excel.Application") w =…
Jeffyx
  • 78
  • 2
  • 9
1 2 3
99
100