Skip to content
Advertisement

Tag: excel

How to insert a picture into Excel at a specified cell position with python (Anaconda) use vba

I try to use this link with vba code but in Python it doesn’t work. AttributeError Traceback (most recent call last) in () 9 sheet.Cells(20, 20).Select 10 #obj1=sheet.Shapes.AddPicture (r’C:/Users/Home/Desktop/picture.jpg’, False, True, 10, 3, 100, 100) —> 11 obj1=wb.ActiveSheet.Pictures.Insert(r’C:/Users/Home/Desktop/picture.jpg’) 12 obj1.ShapeRange 13 obj1.ShapeRange.LockAspectRatio = msoTrue AttributeError: ‘function’ object has no attribute ‘Insert’ Answer Unless you absolutely need to use VBA, this

String/regex search over Excel in Python issue

I’m a newb to SO, and relatively new to Python, so i’m sorry if this is a simple fix or an inappropriate question. Firstly, my program generally works, but i’m trying to implement some redundancy/catchalls for to make it robust. The program looks over a directory (and sub-dirs) of excel files, opens them individually, scours for data (on a specific

Advertisement