+ Reply to Thread
Results 1 to 3 of 3

Enable/Disable macros

Hybrid View

  1. #1
    Adam
    Guest

    Enable/Disable macros

    My file still asks if I want to enable or disable macros even though I have
    deleted all macros.
    Any Ideas?
    /Adam

  2. #2
    Guest

    Enable/Disable macros

    Hi Adam,

    the reason for this is that although the macros have been
    deleted a module folder still exists. In the VB editor
    you will see a module folder. Expand this, then right
    click on the module shown (probably 'Module1') and
    choose 'Remove..'. Click 'No' in the next dialog and
    Save. You won't see the macro dialog when you re-open the
    file.

    Regards,

    TonyM
    >-----Original Message-----
    >My file still asks if I want to enable or disable macros

    even though I have
    >deleted all macros.
    >Any Ideas?
    >/Adam
    >.
    >


  3. #3
    Bob Phillips
    Guest

    Re: Enable/Disable macros

    Adam,

    You could run this code on the workbook

    Dim vbMod As Object

    For Each vbMod In ActiveWorkbook.VBProject.VBComponents
    Select Case vbMod.Type
    Case 1, 2, 3: 'module, class, userform
    ThisWorkbook.VBProject.VBComponents.remove vbMod
    Case Else 'ThisWorkbook, sheet modules
    With vbMod.CodeModule
    .DeleteLines 1, .CountOfLines
    End With
    End Select
    Next vbMod

    Make sure that you don't leave it in the workbook though :-)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <anonymous@discussions.microsoft.com> wrote in message
    news:5c2d01c5261f$d4488010$a501280a@phx.gbl...
    > Hi Adam,
    >
    > the reason for this is that although the macros have been
    > deleted a module folder still exists. In the VB editor
    > you will see a module folder. Expand this, then right
    > click on the module shown (probably 'Module1') and
    > choose 'Remove..'. Click 'No' in the next dialog and
    > Save. You won't see the macro dialog when you re-open the
    > file.
    >
    > Regards,
    >
    > TonyM
    > >-----Original Message-----
    > >My file still asks if I want to enable or disable macros

    > even though I have
    > >deleted all macros.
    > >Any Ideas?
    > >/Adam
    > >.
    > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1