When using excel2img library to take snap of a specific section of a sheet , It is giving below error.
AttributeError: '<win32com.gen_py.Microsoft Excel 16.0 Object Library.Range instance at 0x2697515534376>' object has no attribute 'parent'
The same code worked when used for first time. But it stopped working after that. Just to specify, I am using the same office version as earlier, the only change that I did in between is I installed few Libraries. I dont know if it is due to that.
I tried to change the excel version to .xlsx from .xls. But then it is returning error
"OSError: Failed to open snap.xlsx".
Below is the code which I am using:
import excel2img
excel2img.export_img("snap.xls","alarm_BB1.png","Sheet1!A2:Q20")
excel2img.export_img("snap.xls","VSWR_BB1.png","","Sheet2!A2:Q50")
excel2img.export_img("snap.xls","alarm_BB2.png","","Sheet3!A2:Q20")
excel2img.export_img("snap.xls","VSWR_BB2.png","","Sheet4!A2:Q50")
Below is the error that I am getting:
AttributeError: '<win32com.gen_py.Microsoft Excel 16.0 Object
Library.Range instance at 0x2697515188064>' object has no attribute
'parent'
Below is the snap excel file.both in xls and xlsx format.snap.xlsx