What is the "#" used for in "#If VBA7 Then" in the tutorial;
The pound sign initiates a line of code that is outside a procedure. The normal syntax would be
If VBA7 Then
but if you type this at the top of a module it won't compile. It must be within a sub or function. But that isn't where the condition needs to be in this particular case. So, in order to resolve this conundrum Microsoft added the pound sign to enable this specific exception to the rule.
The point of the If statement is to load either PtrSafe or legacy versions of APIs depending upon your computer and your software. That was quite useful nearly a decade ago when the LongLong data type was first introduced. Today PtrSafe versions should be used unless you have either equipment or software that is older than ten years or, as is the case with the tutorial, you want to be sure that your program can run in such outdated environments.
Read more about this subject here: https://codekabinett.com/rdumps.php?Lang=2&targetDoc=windows-api-declaration-vba-64-bit