Can someone help me with the following? I'm absolutely stumped.
Problem: We are getting a "Excel has encountered problem and needs to close" error during processing.
We have a workbook that contains a macro which generates new workbooks. These workbooks store business metrics for our company's various projects.
It opens an XML file at the start of processing, which tells the macro which projects need to be updated. The metrics are pulled from our database by a perl script, which stores them in text files. The macro uses these text files as input.
After the project's workbook is created, a "rollup" workbook (which keeps track of metrics across projects) is opened, updated, saved, and closed.
The XML file, input text files, and the output-excel workbooks are all saved on a networked drive.
What's been happening is at a certain point every day, excel crashes with the error I mentioned at the start of the post. It isn't always crashing on the same program every day. However, it does consistently crash on the same line of code everyday:
Workbooks(RollupFile).Save
Now here's the particularly vexing fact: If I restart the macro on the program which crashed, it finishes processing without an error.
Yesterday I put a counter that incremented everytime the macro tried to execute that line of code: it executed 570 times, and crashed on the 571st time.
Any ideas as to what may be causing this problem??
Problem: We are getting a "Excel has encountered problem and needs to close" error during processing.
We have a workbook that contains a macro which generates new workbooks. These workbooks store business metrics for our company's various projects.
It opens an XML file at the start of processing, which tells the macro which projects need to be updated. The metrics are pulled from our database by a perl script, which stores them in text files. The macro uses these text files as input.
After the project's workbook is created, a "rollup" workbook (which keeps track of metrics across projects) is opened, updated, saved, and closed.
The XML file, input text files, and the output-excel workbooks are all saved on a networked drive.
What's been happening is at a certain point every day, excel crashes with the error I mentioned at the start of the post. It isn't always crashing on the same program every day. However, it does consistently crash on the same line of code everyday:
Workbooks(RollupFile).Save
Now here's the particularly vexing fact: If I restart the macro on the program which crashed, it finishes processing without an error.
Yesterday I put a counter that incremented everytime the macro tried to execute that line of code: it executed 570 times, and crashed on the 571st time.
Any ideas as to what may be causing this problem??