I’m using a library called Excel2Image in order to take a sheet range in excel and save it as a video. This library uses win32com in order to get an excel application.
Inside of my main program, consistently when I call the library’s ‘export_img’ function at one specific point, the python program terminates despite having no exit
, quit
or sys.exit
type of function. There isn’t an error or anything. It’s just as if I pressed ctrl + c without the keyboard interrupt message. I went inside of the export_img function to find out what could be doing this
print(rng.Parent)
print('-')
for shape in rng.Parent.Shapes:
print(shape)
print('Checkpoint 2.2')
shape = None
del shape
print('Checkpoint 3')
where rng is a worksheet cell range object (rng = excel.workbook.Application.Range(_range)
)
The program terminates at the for loop, not printing a single shape.
Before the edits, the line was just for shape in rng.Parent.Shapes: pass
. The program prints everything up until the for loop where the program just ends. It doesn’t print any shape nor execute any code afterwards. It consistently happens at one part of the program but I couldn’t find out what actually causes it to fail. I tried adding a “try except” and use traceback to find an error if it was surpressed or something, but still nothing came up and the program terminated.