I am trying to autofit the columns in my python generated xlsx file. Found the code from here[https://stackoverflow.com/a/33665967/5518944], but getting an exception. I am using Microsoft Office 2015.
Using this code:
import win32com.client as win32
excel = win32.gencache.EnsureDispatch('Excel.Application')
ends up in following error:
[...]Python36\lib\site-packages\win32com\client\gencache.py", line 236, in GetModuleForCLSID
__import__(sub_mod_name)
ModuleNotFoundError: No module named 'win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x8._Application'
Are you able to help me with this problem?