Temporarily pause macro so that changes can be made on a workbook

  • Thread starter Thread starter Farooq Sheri
  • Start date Start date
F

Farooq Sheri

I have macro that opens up a file ("Book1") and pastes some info onto it from
another file. I have code (While loop) in the macro that checks whether
"Book1" is still open or not. What happens is that with the macro running in
background I am unable to do any action on Book1. I have tried putting in a
Wait timer but things remain the same. Is there a way to get around this. I
want the code to continue once I close Book1.

Thanks in advance
 
Try putting a STOP command in your code where you want the macro to pause.

HTH,
Matthew Pfluger
 
I have macro that opens up a file ("Book1") and pastes some info onto it from
another file. I have code (While loop) in the macro that checks whether
"Book1" is still open or not. What happens is that with the macro running in
background I am unable to do any action on Book1. I have tried putting in a
Wait timer but things remain the same. Is there a way to get around this. I
want the code to continue once I close Book1.

Thanks in advance

It sounds like you want to add a DoEvents in the macro loop. It
should allow manipulation of data in the target spreadsheet.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
 
thanks for the reply; I have tried putting "Stop" command and the macro does
stop but it won't start unless I do so manually. Is there a way to auto start
it once a certain condition is met such as when I close Book1.
 
Can you please be specific; the macro should stop but should restart once
Book1 is closed.

Thanks
 

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