Hi, I’ve been scratching my head on this one for a couple of days now and have tried a number of things to mitigate, with no success.
Problem
Running a looping process to generate Excel documents. At the end of the Excel writing process I’m executing VBA code held in a text file to carry out some formatting.
The process produces around 900 documents - the VBA code is erroring on a number of them causing the formatting to not be carried out.
Steps So Far
I added delays - no change
I took the Invoke VBA code out of the single application scope and added it to a separate scope - added a Kill Process between the scopes to ensure the excel is dead - no change
Made the VBA scope visible - no change
I’ve tried to look up the HRESULT error code, but can find no reference to this code at all.
Creating a module in Excel VBA and running the macro from within the application works on the documents that are otherwise failing, so I don’t believe it’s a code issue, although I’m not ruling it out…
Any help would be appreciate.
TIA
Paul