Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
programming VBE - Deleting All Code From A Module
hello,
i have a file remove.xls in which i use such a code: Sub DeleteAllCodeInModule() Dim VBCodeMod As CodeModule Dim StartLine As Long Dim HowManyLines As Long Set VBCodeMod = Workbooks("new.xls").VBProject.VBComponents("Sheet s4").CodeModule With VBCodeMod StartLine = 1 HowManyLines = .CountOfLines .DeleteLines StartLine, HowManyLines End With End Sub to remove Private Sub Worksheet_Calculate() in new.xls than i save and close file, but on reopening new.xls an information about existing macros is appears and i do not know why? there is no VBA code in file. i checked carefully other sheets and ThisWorkbook and they are empty... does somebody has any idea what is going on? i use office xp.. regards peter |
#2
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
programming VBE - Deleting All Code From A Module
Hi Pm
You must delete the empty module also http://www.contextures.com/xlfaqMac.html#NoMacros -- Regards Ron de Bruin http://www.rondebruin.nl "pm" wrote in message ... hello, i have a file remove.xls in which i use such a code: Sub DeleteAllCodeInModule() Dim VBCodeMod As CodeModule Dim StartLine As Long Dim HowManyLines As Long Set VBCodeMod = Workbooks("new.xls").VBProject.VBComponents("Sheet s4").CodeModule With VBCodeMod StartLine = 1 HowManyLines = .CountOfLines .DeleteLines StartLine, HowManyLines End With End Sub to remove Private Sub Worksheet_Calculate() in new.xls than i save and close file, but on reopening new.xls an information about existing macros is appears and i do not know why? there is no VBA code in file. i checked carefully other sheets and ThisWorkbook and they are empty... does somebody has any idea what is going on? i use office xp.. regards peter |
#3
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
programming VBE - Deleting All Code From A Module
Ron de Bruin wrote:
Hi Pm You must delete the empty module also http://www.contextures.com/xlfaqMac.html#NoMacros sure ;) but as i wrote i run deleting macro from other file (remove.xls) in order to delete private sub code in sheets in new.xls (which is one existing code in this file) in new.xls there is only 1 code in Sheets4. no free modules btw he http://miodek.no-ip.org/~prob/PL_1000_21-12-2005.xls you can find such a file after deleting private sub from Sheets5 (revenues), but on when file is opening a warning about macros occurs... find a VBA code in this file, get beer ;) |
#4
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
programming VBE - Deleting All Code From A Module
When you open that file via the link provided you are prompted with the
macro warning, but once you have saved down the file, closed it and then reopened it there is no more warning after that. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ------------------------------*------------------------------*---------------- It's easier to beg forgiveness than ask permission :-) ------------------------------*------------------------------*---------------- "pm" wrote in message ... Ron de Bruin wrote: Hi Pm You must delete the empty module also http://www.contextures.com/xlfaqMac.html#NoMacros sure ;) but as i wrote i run deleting macro from other file (remove.xls) in order to delete private sub code in sheets in new.xls (which is one existing code in this file) in new.xls there is only 1 code in Sheets4. no free modules btw he http://miodek.no-ip.org/~prob/PL_1000_21-12-2005.xls you can find such a file after deleting private sub from Sheets5 (revenues), but on when file is opening a warning about macros occurs... find a VBA code in this file, get beer ;) |
#5
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
programming VBE - Deleting All Code From A Module
Ken Wright wrote:
When you open that file via the link provided you are prompted with the macro warning, but once you have saved down the file, closed it and then reopened it there is no more warning after that. ;) so, this is the answer.. thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
regular code module | Excel Discussion (Misc queries) | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) | |||
Change case...help please | Excel Worksheet Functions | |||
Macro for changing text to Proper Case | Excel Worksheet Functions | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions |