Remove Code Modules By Name

  • Hi

    The following code removes all macros from my workbook:

    However, I have a macro called Wind() which I do not want removed. The code above references the VB component by a number, X, but this value may vary for Wind() . Therefore, is it possible to reference the VB component by name, and if that name is equal to Wind() , then the VB component will not be removed?

    Many thanks if anyone can help,


  • Re: Referencing A Vb Component By Name

    Shame, I had some great code for removing all but a single proc.

  • Re: Referencing A Vb Component By Name

    Thanks Bob[hr]*[/hr] Auto Merged Post Until 24 Hrs Passes;[dl]*[/dl]Arh, about telling it not to delete a userfom called "Class"??


  • Re: Referencing A Vb Component By Name

  • If you wish to continue using this free service.

    Please be considerate of others who use the forum for searching. Your current Thread Title (which I will change) is non-reflective of your immediate problem.

    In future, please take 1 minute of your time to read the text on the New Thread page.


    REMEMBER: Your thread title should NEVER be what you THINK is your answer. 9 times out 10 it will wrong and prevent someone from finding a solution to a simliar issue.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!