Option Explicit - Not Working - Fix
Yes. It is very strange that my client reported that Excel app I delivered gave "Variable not defined" error. But, whenΒ I opened by VB/VBA project -> Debug -> Compile Project. There was no error. It was all working fine when I run the code. Then how to find the undeclared variable? Read this solution carefully. It is the strangest ever solution you will ever hear. Follow these steps: After typing Option Explicit, type a space & then Press Enter.- Type Option Explicit
- Don't press Enter.
- Type a SPACE in same line as 'Option Explicit' (At end of this command).
- Then press Enter.