View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter Rooney Peter Rooney is offline
external usenet poster
 
Posts: 325
Default 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