Good Morning,
I apologize in advance if this has been covered ad nausea. I am working in VB.Net 2008. I am creating a DLL for use in another application and also Microsoft Excel. The DLL is a series of mathematical equations in "Public Functions."
I am wondering how or if I should handle errors in the dll. I usually use this type of handler:
I know I can take every precaution in the main app and the excel vba in order to make sure proper data entry so errors don't occur, but experience has taught me, if there is a hole, a user will find it.
Generally, I like to log errors in a table (if a database) or text, xml, or other type of file, but trying that in the dll doesn't seem quite right to me.
So my question is: How should I handle this?
Thank you,
Craig
I apologize in advance if this has been covered ad nausea. I am working in VB.Net 2008. I am creating a DLL for use in another application and also Microsoft Excel. The DLL is a series of mathematical equations in "Public Functions."
I am wondering how or if I should handle errors in the dll. I usually use this type of handler:
VB.NET:
On Error GoTo Error_Handler
'Do something here
Error_Handler_Exit:
Exit Sub '(or function)
Error_Handler:
'Handle the error somehow here
Err.Clear
Resume Error_Handler_Exit
I know I can take every precaution in the main app and the excel vba in order to make sure proper data entry so errors don't occur, but experience has taught me, if there is a hole, a user will find it.
Generally, I like to log errors in a table (if a database) or text, xml, or other type of file, but trying that in the dll doesn't seem quite right to me.
So my question is: How should I handle this?
Thank you,
Craig