Forum Discussion
hrh_dash
Jul 26, 2022Iron Contributor
Save xlsm in another workbook as xlsx and remove all user form controls
Is there a way to save xlsm in another workbook as xlsx and remove all user form controls? The code below work perfectly but I would like to remove the user form controls when saved in xlsx file ...
- Jul 27, 2022
hrh_dash Controls are shapes, so call this sub to remove them from the active worksheet:
Sub RemoveControls() Dim shp As Shape For Each shp In ActiveSheet.Shapes If shp.Type = msoOLEControlObject Or shp.Type = msoFormControl Then shp.Delete End If Next End Sub
JKPieterse
Jul 27, 2022Silver Contributor
hrh_dash Controls are shapes, so call this sub to remove them from the active worksheet:
Sub RemoveControls()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = msoOLEControlObject Or shp.Type = msoFormControl Then
shp.Delete
End If
Next
End Sub