• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Save File without Text Boxes

I have a spreadsheet with Textboxes and Buttons on. Is it possible to save the file without theses boxes. So when it is emailed it is just the data not the boxes.

This is my save script.

Sub Button2238_Click()
Dim vFilename As Variant

vFilename = Application.GetSaveAsFilename(FileFilter:="Microsoft Excel Workbooks,*.xls")

If vFilename <> False Then ActiveWorkbook.SaveAs vFilename

End Sub
 
Hi Lesley,

Once you do the saveasworkbook just delete all the textbox and buttons and save the workbook. below is the code to delete the activex objects.

Sub delobj()

Dim obj As OLEObject

For Each obj In ActiveSheet.OLEObjects
obj.Delete
Next

End Sub

Regards
Matheen
 
Hi lesley,

Before you save, you could run a macro like this to delete all the shapes.
Code:
Sub ClearShapes()
Dim ws As Worksheet
Set ws = ActiveSheet
ws.Shapes.SelectAll
Selection.Delete
End Sub
 
Back
Top