I need to loop through a folder of excel files and delete the drawing objects on specified sheets within each workbook.. I have found the following code to delete
shapes on an active worksheet,
Sub DeleteShapes()
Dim Shp As Shape
For Each Shp In ActiveSheet.Shapes
Shp.Delete
Next Shp
End Sub
but I need to loop through an entire directory of excel files and delete the shapes on two specified named tabs. Each file has the same two named tabs. Is there a way to automate this process? I cannot get the workbook open Method to work without an error.
Thanks!
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.