Hi there,
I have a pretty simple macro in my excel file that runs a few basic goal seeks. Unfortunately, this code has a tendency to crash frequently, especially when the user's inputs are too off and/or when the result is difficult or impossible to find for Excel. Usually what happens is that the macro starts running and crashes Excel. I've tried adding an "EnableCancelKey = xlErrorHandler" to give a way out for users when the macro crashes but it does not work every time.
To give some context, the macro is trying to assess the maximum purchase price based on certain targeted return indicators (COC, CF, IRR, MIRR) provided by the user.
So my questions:
- Is there a more "solid" approach to achieve the same result without using .GoalSeek?
- What could I do to make that code less subject to crash? How can I better handle crashes when they occur?
- Anything else I could do to improve the code?
Thanks!
Bookmarks