Hello,
I have a question about error management in vba.
I have a subroutine That have error management, and launch an err.raise.
When this sub is called from another sub, executed from a button, and then an error occurs, Everything is fine, my error message is displayed.
But when same sub is used in an event pivottableupdate or from a keyboard shortcut I have set, the message 'automation error' appears instead of my error message.
After some researches seems in some cases an err.raise cannot be executed.
I thought it was always when a sub is launched from an excel event, but it works fine in some events Like worksheet_change but not in pivottableupdate for example.
Is any one have some feedback or experience or resource to share on it and could give me some advice on how I could manage correclty an error raising which could work in all cases?
Hope I m clear, thank a lot.
I have a question about error management in vba.
I have a subroutine That have error management, and launch an err.raise.
When this sub is called from another sub, executed from a button, and then an error occurs, Everything is fine, my error message is displayed.
But when same sub is used in an event pivottableupdate or from a keyboard shortcut I have set, the message 'automation error' appears instead of my error message.
After some researches seems in some cases an err.raise cannot be executed.
I thought it was always when a sub is launched from an excel event, but it works fine in some events Like worksheet_change but not in pivottableupdate for example.
Is any one have some feedback or experience or resource to share on it and could give me some advice on how I could manage correclty an error raising which could work in all cases?
Hope I m clear, thank a lot.