Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you going to make it an XLT, then the xlt will not be affected by any
code. It will only affect the workbook created from the xlt. While working with the xlt, you should disable events before saving, or put a check in your code so the shapes are not deleted if the userid is you (for example). Or you can comment out the code until you convert the workbook to an XLT. -- Regards, Tom Ogilvy "ole_" wrote in message ... Bob, how do i save it without removing the commandbuttons. When i put the code in Thisworkbook like this: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) '---------------------------------------------------------------- 'Sub RemoveShapes() '---------------------------------------------------------------- Dim shp As Shape Dim sTopLeft As String Dim fOK As Boolean For Each shp In ActiveSheet.Shapes fOK = True testStr = "" On Error Resume Next sTopLeft = shp.TopLeftCell.Address 'Autofilter and Data Validation dropdowns 'don't seem to have a topleftcell address. On Error GoTo 0 If shp.Type = msoFormControl Then If shp.FormControlType = xlDropDown Then If testStsTopLeftr = "" Then 'keep it fOK = False End If End If End If If fOK Then shp.Delete End If Next shp End Sub The new workbook is without commandbuttons, but also pricelist.xls is without commandbutton's? How can i save the code in pricelist.xls without removing the commandbuttons, don't ask me how i did it in the test file, i still have the test file and it's with CB. Ole |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 | Excel Discussion (Misc queries) | |||
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION | Excel Discussion (Misc queries) | |||
"Save" and "Save As" options greyed out - "Save as Webpage" option | Excel Discussion (Misc queries) | |||
Removing "Save As" Command from an excel file. | Excel Worksheet Functions | |||
save and restore "Workbook Menu Bar" & "Cell" menus | Excel Programming |