Diabling Target Workboon Macos (if necessary)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Hi, ExcelMonkey,
You can use application.enableevents=true/false
This will suppress the execution of event macros and restart it as required.
Cheers

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top