Dear VBA experts and fans,
I created an excel system that is full of VBA code and we give it to the client - with the code locked for viewing. Of course, there was soon a request that the client encountered an error, so I put "bookmarks" into the whole code - I divided the code into parts (parts smaller than procedures) and at the beginning of each part is assigned a simple global string variable and this is logged in Excel sheet together with the error code in case of error, so I know which was the last part before the error.
But it's still not enough debug solution, as it would be in the case of unlocked code, where VBE nicely marks which line caused an error.
Should I take it as a sad fact, that locked VBA/VBE simply cannot give me the text nor any other identification of the line that caused the error while the code is locked? Can't a line of code be considered an object I can work with?
I do not consider as solution:
- numbering lines or error handlers https://stackoverflow.com/questions/36553813/find-error-line-number-in-vba - because it is extremely laborious to find the exact line
- or my "bookmark" solution above, which is basically just another error handler
Thank you in advance.
Mark
I created an excel system that is full of VBA code and we give it to the client - with the code locked for viewing. Of course, there was soon a request that the client encountered an error, so I put "bookmarks" into the whole code - I divided the code into parts (parts smaller than procedures) and at the beginning of each part is assigned a simple global string variable and this is logged in Excel sheet together with the error code in case of error, so I know which was the last part before the error.
But it's still not enough debug solution, as it would be in the case of unlocked code, where VBE nicely marks which line caused an error.
Should I take it as a sad fact, that locked VBA/VBE simply cannot give me the text nor any other identification of the line that caused the error while the code is locked? Can't a line of code be considered an object I can work with?
I do not consider as solution:
- numbering lines or error handlers https://stackoverflow.com/questions/36553813/find-error-line-number-in-vba - because it is extremely laborious to find the exact line
- or my "bookmark" solution above, which is basically just another error handler
Thank you in advance.
Mark