LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default remove vba and functions when saving worksheet

Assuming they are control toolbox buttons, add this at the end

ActiveSheet.OLEObjects("CommandButton1").Delete


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"john tempest" wrote in message
...
this is the code i am using at the moment
Private Sub CommandButton1_Click()
Dim wkbk As Workbook, sh As Worksheet
Worksheets("TIMESHEET").Copy
Set wkbk = ActiveWorkbook
' get rid of all cell formulas
For Each sh In wkbk.Worksheets
With sh.UsedRange
.Value = .Value
End With
Next
wkbk.SaveAs "C:\Documents and Settings\Administrator\My
Documents\HOWDENS\TIMESHEET\ " & Sheets("TIMESHEET").Range("B5") & ".xls"
wkbk.Close
End Sub
this code removes the functions but the command button is stil functional
but does not do anything.when i save the worksheet i want the command

button
to be non functional or if possible disappear altogether. am i asking too

much
thankyou john tempest

"Bob Phillips" wrote:

In the save itself? If yes, see http://www.cpearson.com/excel/vbe.htm on

how
to delete a code module.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"john tempest" wrote in message
...
can i remove vba and functions when saving a worksheet
thankyou john tempest






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving user defined functions Lawdog New Users to Excel 1 December 15th 08 01:07 AM
after saving excel 2003 file, functions do not update anymore Sven Martin Excel Discussion (Misc queries) 5 July 7th 08 01:35 PM
how do i remove template help functions hans Excel Discussion (Misc queries) 2 June 2nd 08 10:34 PM
Remove content when saving / loading spreadsheet EZdoesIT Excel Worksheet Functions 4 November 13th 06 03:42 PM
remove query table when saving Michael Excel Programming 3 September 8th 05 10:04 AM


All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"