In Excel VBA, is it good practice to leave Debug.Print instructions in code that goes in “production” ? That is quite useful to debug the sheets realtime at the user’s machine when something goes wrong. Does it affect performance when Visual Studio is closed ? If not, what would you advise ?
In Excel VBA, is it good practice to leave Debug.Print instructions in code that
Share
Debug.Print instruction DO have a small performance cost. So I would avoid them in loops that are executed a zillion times. Except for those cases, I think it’s ok to keep them.
You could also use conditional compilation directives (
#if) in combination with a compiler constant (#const) to enable/disable them globally without performance impact.