Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
commandbutton removal
Please help,
When i do a saveas and sendmail; the new file contains the original command button and the macro associated with the button, I want to remove to button in the newly copied file during the saveas function. Any ideas? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
commandbutton removal
hi
you problem comes from the saveas that you are doing. this saves the file under a different name along with the data , controls, macros and all else. what you need to do is just save the range of data to a new workbook and email that. how? paste this in a standard module. you can fire it from a worksheet button or a toolbar icon. Sub mac1SaveRange() 'Macro written by FSt1 4/27/00 Dim cnt As Long Dim cell As Range On Error GoTo err1 MsgBox "You have selected range" & Selection.Address If Selection.Cells.Count = 1 Then If MsgBox("You have selected only one cell. Continue?", vbYesNo, "Warning") = vbNo Then Exit Sub End If End If cnt = 0 For Each cell In Selection If Not IsEmpty(cell) Then cnt = cnt + 1 End If Next If cnt = 0 Then If MsgBox("There is no data in the selected range. Continue?!?!?!?!?", vbYesNo, "Warning") = vbNo Then Exit Sub End If End If 'ActiveSheet.UsedRange.Select Selection.Copy Workbooks.Add Range("A1").PasteSpecial xlPasteAll Application.Dialogs(xlDialogSaveAs).Show err1: MsgBox ("Need a range to save.") Exit Sub End Sub Post back if you have questions Regards FSt1 "Kip" wrote: Please help, When i do a saveas and sendmail; the new file contains the original command button and the macro associated with the button, I want to remove to button in the newly copied file during the saveas function. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Removal of Zero | Excel Worksheet Functions | |||
function removal | Excel Discussion (Misc queries) | |||
.xla removal | Excel Programming | |||
Number removal | Excel Worksheet Functions | |||
Add-in removal | Excel Programming |