View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Remove macro programmatically

Rightclick on that worksheet tab that used to own that button.
Select View Code
Select the code window
hit ctrl-a to select all the text in that window
hit the delete key to clear that window

Save the workbook.


Debra Dalgleish shows how to clean up all the remnants of macros:
http://www.contextures.com/xlfaqMac.html#NoMacros

wrote:

Hi I have the following proceedure sat in a worksheet (sheet1):

Private Sub CommandButton1_Click()
RefreshSheets
End Sub

I have been able to successfully get rid of the sub called
'RefreshSheets' from my module, so the code does absolutely nothing
(and CommandButton1 has also been deleted programatically), but how to
I get rid of this redundant code that remains.

I need to remove it as the workbook still thinks it contains a macro
(even tho there is no actual code within the resulting sub!) and so
when I email the workbook, the recipients email client rejects it as
harmful.

Any help greatly appreciated.

Cheers!


--

Dave Peterson