I'm using Python 3 and working in Pycharm.
I was able to get pywin32 and win32com working on one project, but since I have tried importing them into a new project, they don't seem to be working. At first I was getting No module named 'win32api', but I updated the win32com\__init__.py
from import win32api
to from win32 import win32api
. That seems to have fixed the initial error, but now I'm getting No module named '_win32com'. This seems to be from issues with \pythoncom\__init__.py
maybe?
I've tried uninstalling and reinstalling pywin32
and pypiwin32
as well.
Example of code here:
import win32com.client as win32
xlapp = win32.DispatchEx("Excel.Application")
wbe = xlapp.workbooks.open(r"C:\Users\me\example.xlsx")