+ Reply to Thread
Results 1 to 2 of 2

Diabling Target Workboon Macos (if necessary)

  1. #1
    ExcelMonkey
    Guest

    Diabling Target Workboon Macos (if necessary)

    I have a macro which searches cells of a target workbook:

    For Each Cell In sh.UsedRange
    'Do something
    Next Cell

    If this search occurs on a target workbook which has macros in the sheet
    being searched (i.e. Workbook_SheetSelectionChange events or events triggered
    by selecting cells), will this affect the routine? I gues I am not sure if
    the routine triggers any of these events. As its a collection, I have been
    assuming that this should not matter.

    If it does, what can I do to avoid this from happening? Am I forced to
    manually comment out code in target file? I am assuming that I cannot
    disable macros as my search is also based on a macro.

    Thanks

    EM

  2. #2
    Peter Rooney
    Guest

    RE: Diabling Target Workboon Macos (if necessary)

    Hi, ExcelMonkey,
    You can use application.enableevents=true/false
    This will suppress the execution of event macros and restart it as required.
    Cheers

    Pete


    "ExcelMonkey" wrote:

    > I have a macro which searches cells of a target workbook:
    >
    > For Each Cell In sh.UsedRange
    > 'Do something
    > Next Cell
    >
    > If this search occurs on a target workbook which has macros in the sheet
    > being searched (i.e. Workbook_SheetSelectionChange events or events triggered
    > by selecting cells), will this affect the routine? I gues I am not sure if
    > the routine triggers any of these events. As its a collection, I have been
    > assuming that this should not matter.
    >
    > If it does, what can I do to avoid this from happening? Am I forced to
    > manually comment out code in target file? I am assuming that I cannot
    > disable macros as my search is also based on a macro.
    >
    > Thanks
    >
    > EM


+ 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