We have 2 macros - say M1 and M2.
The M1 macro is working correctly.
The M2 macro is not working as expected (there are no compile/run-time errors) and the reason for this is that 1 file is missing in this macro M2. Say F1.bas. This file has the foll. code:
Public Const REG_SZ As Long = 1
The other files in the macro refer to this REG_SZ. On Macro M1 if I right click on the REG_SZ in the other files and click on Definition, then it takes me to the F1.bas file on this line.
However, on the M2 although I have imported the F1.bas file, and compiled the code; If I right click on the REG_SZ in the other files and click on Definition, then it gives an popup that says: "Identifier under cursor is not recognized".
My understanding is that any public variable in the module file should be globally accessible. Is there something that I am missing to establish the link, do we need to do something else when importing a module file?
OPTION EXPLICIT. That will avoid you some situations where a module compiles but gives a runtime error.