View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
ddiicc ddiicc is offline
external usenet poster
 
Posts: 42
Default How to Delete Another WorkBook Macros using Macros.. Possible?

Hi Norman,
Thanks for responding, I am rather a beginner in macro writing,
So I would like to ask on how to add in the code that you given.
Eg..My ending of the macros is stated below.

ActiveWorkbook.SaveAs Filename:="E:\Jong\Python A HSA\HSA Yield For All
Lines 2005\C LGC\All HSA LGC Stations Yield\G Jul 2005 LGC Yield\HSA LGC01
All Model 1st Pass Yield Jul 2005.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, CreateBackup:=False

End Sub


So how do I add in the script you have given, I have about 11 modules to
delete
after the workbook is saved as stated on the above...

Regards ddiicc

"Norman Jones" wrote:

Hi Ddiicc,

Try:

Sub DeleteModule()
Dim VBComp As VBComponent
Set VBComp = Workbooks("Book2.xls").VBProject. _
VBComponents("NewModule")
Workbooks("Book2.xls").VBProject.VBComponents.Remo ve VBComp
End Sub


---
Regards,
Norman



"ddiicc" wrote in message
...
Hi Norman,

What If I want to delete a module in another workbook 2 using the module
in
workbook 1... so how should go about writing this in workbook module???



"Norman Jones" wrote:

Hi Ddiicc,

See Chip Pearson VBE programming page at:

http://www.cpearson.com/excel/vbe.htm

See particularly the section entitled: Deleting A Procedure From A Module


---
Regards,
Norman



"ddiicc" wrote in message
...
Hi to the experts in excel programming.

What is the commands or script for deleting a macro automatically using
another workbook macro.