PDA

View Full Version : Code interrupted after running another workbook



DevanG
06-23-2011, 05:43 AM
So, I run a function and want to return a value. When running the function I open up two other workbooks, one closes and leaves the value in the other. Problem is, the whole code stops once they run. I think its because the one that closes has another button you have to press to finish it. How do I get around this? go back to my orginal code?
RKrev = RunRepricing(InvestAllo, TheFile)
Workbooks(Summary).Activate
Workbooks(Summary).Sheets(1).Range("T5").Value = RKrev

At the end of RunRepricing, the sub of the other workbook is run, then its SUPPOSED to close the other opened workbook. That never happens. Then it never performs the two lines after it.

Bob Phillips
06-23-2011, 07:16 AM
Are you sure the correct workbook is being closed?

DevanG
06-23-2011, 08:01 AM
Are you sure the correct workbook is being closed?

yes, I'm left with the right workbook with its information. That one is also supposed to be closed once the data is stored, but it never makes it to that point.

Bob Phillips
06-23-2011, 09:32 AM
Sorry, I can't see the problem then, as I said, it seems to work fine in my test.