View Single Post
  #1   Report Post  
garygoodguy garygoodguy is offline
Junior Member
 
Posts: 29
Default Ignoring a runtime error

Hi,

I have 7 workbooks (all the same template structure). I also have a mapping workbook that acts as a data source for each. So when any of the 7 workbooks are opened, the mapping workbook opens (and remains open) in the background. When the template workbooks are closed some more vba closes the mapping in the background without saving.

What I'm wanting to do is to have another separate workbook that consolidates all of these 7 workbooks into one consolidated total. To do this I'll use the consolidate function in Data -- Consolidate.

How can I do this? I'm assuming I will have to open all 7 workbooks (and also the mapping workbook) in the background so that the cells will update? Correct? Is this the best way to go about it? Do we have to have all of these workbooks open for data to update?

Also, if this is true, then I will need to close all hidden workbooks in the background when the consolidated workbook is closed. The problem comes in when each of the 7 workbooks closes their is vba line that wants to close the mapping workbook. So when the first workbook closes, it will close the mapping workbook, but for the remaining 6 I will get a runtime error because the mapping workbook has now been closed.

How do I get around this? Will I have to put some vba code in each of the 7 workbooks to say, if error message X, then ignore, else...? If so, does anyone know how to ignore a specific runtime error and continue on?

Sorry for the long-winded intro, but needed to detail this.
Thanks in advance.