用 python 库 excel2img 在excel 中 截 图 报 错:AttributeError: '<win32com.gen_py.Microsoft Excel 16.0 Object Library.Range instance at 0x2039866355584>' object has no attribute 'parent'. Did you mean: 'Parent'? 如下图所示:
object has no attribute 'parent'遇到上述问题只需要打开excel2image.py文件,把“for shape in rng.parent.Shapes: pass”这句代码(大概在113行)里面的parent改成Parent即可。
excel2imag.py