DEV Community

Discussion on: How to diff Excel VBA code in SourceTree (Git client)

Collapse
 
fzumstein profile image
Felix Zumstein

How are you prefixing line numbers?

Collapse
 
charlesrhall profile image
Charles Hall

It is a capability/feature in the VBA/VB development environments - one can add line numbers to each line of code, and then add the line number to any error message so that one knows which line of code was being executed when the error occurred.

Thread Thread
 
charlesrhall profile image
Charles Hall

It just occurred to me that the above is not accurate - the prefixing line numbers is part of a developer's addin called MZ-TOOLS - which I have used forever (hence why I thought it was part of the IDE)

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
charlesrhall profile image
Charles Hall

I don't think I have explained myself - although the addin creates the numbers, the standard VBA interpreter uses them when an error occurs - without embedded line numbers, the error handling can not tell where the error occurred in a subroutine or function. So they are critical to providing support after the application is released.

Thread Thread
 
fzumstein profile image
Felix Zumstein

Hey just understood now what's going on. Yes, MZ-Tools adds the line numbers as part of the code, so there's nothing really that we can do about that. Except ask Microsoft to add line numbers to the VBA editor ;)