LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Code & modules are gone, Macro warning message remains

Hy Byron,
Take a look at Chip Pearson's
Deleting All VBA Code In A Project
http://www.cpearson.com/excel/vbe.htm

If he missed something, I'm sure he would be interested.
But you will see that it deletes Standard Modules, Forms,
Class Modules as well as emptying sheets of code.

I believe you did not remove the forms.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Byron" wrote in message ...
I have an Excel Workbook where users can fill out a form and then press a
command button on the Sheet that saves a copy of the file into a pre-defined
directory. I don't want the copied version of the Workbook to have any of the
VBA code or the command button in it so I tried to remove them using the
following code inside the copy subroutine:
...
With ActiveWorkbook.VBProject.VBComponents("Sheet1").Co deModule
.DeleteLines 1, .CountOfLines
End With
ActiveWorkbook.ActiveSheet.OLEObjects("My_Button") .Delete
...
The code and the button are removed just fine from the copied file, but when
I open the new copy of the Workbook, Excel gives me the Macro warning
message. I have checked in the Visual Basic Editor and there are no
additional modules attached to the Workbook and there is no code in any of
the Sheet modules or the ThisWorkbook module.

How can I completely get rid of the button and code so that I no longer get
the Macro warning message?

Thanks in advance.



 
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
Macro Warning Message Tendresse Excel Discussion (Misc queries) 0 February 29th 08 07:44 AM
Macro Warning Message Lisa Neron Excel Discussion (Misc queries) 5 January 16th 08 01:27 AM
Stoping the Macro Warning Message Jurrasicway Excel Discussion (Misc queries) 5 June 19th 06 02:56 PM
What is the VBA code to delete a sheet without warning message? [email protected] Excel Discussion (Misc queries) 2 August 9th 05 04:16 PM
getting a macro warning, even through there is no code Sandy[_5_] Excel Programming 4 November 15th 03 03:15 PM


All times are GMT +1. The time now is 08:06 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"