M
Mark Olbert
I've got a weird situation with a macro that I'm not sure how to go about debugging. This is all within Excel 2007.
From time to time (i.e., not always), the macro fails at a point where I first load a workbook and then immediately save it as an
Excel 2003 file. And it fails by crashing Excel.
Here's the weird part: if I single-step through the macro it never fails. In other words, there's nothing wrong with the logic.
This feels like some kind of file system dependency coupled to a hidden asynchronous behavior in Excel. Like the file load isn't
complete but the macro "thinks" it is and continues on.
I tried inserting Application.Wait <delay 5 seconds> into the flow, but that didn't prevent the crashes.
How the heck do I debug something that works in the debugger but fails in use??
- Mark
From time to time (i.e., not always), the macro fails at a point where I first load a workbook and then immediately save it as an
Excel 2003 file. And it fails by crashing Excel.
Here's the weird part: if I single-step through the macro it never fails. In other words, there's nothing wrong with the logic.
This feels like some kind of file system dependency coupled to a hidden asynchronous behavior in Excel. Like the file load isn't
complete but the macro "thinks" it is and continues on.
I tried inserting Application.Wait <delay 5 seconds> into the flow, but that didn't prevent the crashes.
How the heck do I debug something that works in the debugger but fails in use??
- Mark