refresh a folder

J

JT

My "process" macro cycles through a folder and opens each workbook and does
stuff to it. When it is finished, it closes the workbook and moves it to a
"completed" folder.

The workbooks are sent to this folder by our cost centers with another
macro. During month-end, the volume of worbooks submitted by the cost
centers increases significantly.

I've noticed the "process" macro only processes workbooks submitted prior to
starting this macro. Any workbook submitted by the cost centers after the
macro has started (and is running) does not get processed. I have to
re-start the "process" macro and cycle through the folder again to get the
"new" workbooks processed.

Is it possible to programmatically "refresh" the folder each time a workbook
is processed so any "new" workbook submitted while the macro is running is
processed?

Thanks for the help.
 
B

Barb Reinhardt

Without knowing what you've got set up, you could probably do something like
this

Before you start looping through the workbooks

Dim WBFound as Boolean

Do
WBFound = False

'Put all your Workbook Processing here
'When you process a workbook, set WBFound = TRUE


Loop while WBFound = TRUE
 

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

Top