mhammond / pywin32

Python for Windows (pywin32) Extensions
5.05k stars 796 forks source link

The bug where the COM object of an open Excel file cannot be retrieved. #2363

Open 78syh opened 2 months ago

78syh commented 2 months ago

For all bugs, please provide the following information:

Expected behavior and actual behavior

I want to modify the open Excel file, but I cannot retrieve the object.

os.startfile(excel_file)
time.sleep(5)
excel_app = win32com.client.GetActiveObject("Excel.Application")

System information

Python version and distribution: 3.10.11

pywin32 version: 306

Installed from PyPI or exe installer: PyPI

Office Version : Office professional plus 2019

Windows Version: windows 10 20h2

DLL locations: default

Avasam commented 2 months ago

@78syh Can you please provide a minimal reproducer and the complete error in textual form? (not a screenshot)