close

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(quot;new.xlsquot;).VBProject.VBComponents(quot;Sheet s4quot;).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

Hi Pm

You must delete the empty module also
www.contextures.com/xlfaqMac.html#NoMacros--
Regards Ron de Bruin
www.rondebruin.nlquot;pmquot; gt; wrote in message ...
gt; hello,
gt;
gt; i have a file remove.xls in which i use such a code:
gt;
gt; Sub DeleteAllCodeInModule()
gt; Dim VBCodeMod As CodeModule
gt; Dim StartLine As Long
gt; Dim HowManyLines As Long
gt;
gt; Set VBCodeMod = Workbooks(quot;new.xlsquot;).VBProject.VBComponents(quot;Sheet s4quot;).CodeModule
gt; With VBCodeMod
gt; StartLine = 1
gt; HowManyLines = .CountOfLines
gt; .DeleteLines StartLine, HowManyLines
gt; End With
gt;
gt; End Sub
gt;
gt; to remove Private Sub Worksheet_Calculate() in new.xls
gt;
gt; than i save and close file, but on reopening new.xls an information about
gt; existing macros is appears and i do not know why?
gt; there is no VBA code in file. i checked carefully other sheets and ThisWorkbook
gt; and they are empty...
gt;
gt; does somebody has any idea what is going on? i use office xp..
gt;
gt; regards
gt; peter
Ron de Bruin wrote:

gt; Hi Pm
gt;
gt; You must delete the empty module also
gt; 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 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

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 :-)
------------------------------*------------------------------*----------------quot;pmquot; gt; wrote in message ...
gt; Ron de Bruin wrote:
gt;
gt;gt; Hi Pm
gt;gt;
gt;gt; You must delete the empty module also
gt;gt; www.contextures.com/xlfaqMac.html#NoMacros
gt;
gt; sure but as i wrote i run deleting macro from other file
gt; (remove.xls) in order to delete private sub code in sheets
gt; in new.xls (which is one existing code in this file)
gt;
gt; in new.xls there is only 1 code in Sheets4. no free modules
gt;
gt; btw he miodek.no-ip.org/~prob/PL_1000_21-12-2005.xls
gt; you can find such a file after deleting private sub from
gt; Sheets5 (revenues), but on when file is opening a warning about
gt; macros occurs... find a VBA code in this file, get beer
Ken Wright wrote:

gt; When you open that file via the link provided you are prompted with the
gt; macro warning, but once you have saved down the file, closed it and then
gt; reopened it there is no more warning after that.so, this is the answer..

thank you

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()