CopyPicture method of Range class failed – Python
I am running into the following error in Python pywintypes.com_error: (-2147352567, ‘Exception occurred.’, (0, ‘Microsoft Excel’, ‘CopyPicture method of Range class failed’, ‘xlmain11.chm’, 0, -2146827284), None) when trying to copy charts from an excel file into an email. The error however only appears sometimes. I have read some other threads relating to this error and have added a time aspect time.sleep(8)
so it waits a certain amount of seconds before copy the chart after opening the excel. I have also added the excel.CutCopyMode = False
which was another suggestion but nothing seems to be working consistently. I am new to python so any help would be great!