Hi All,
I have been using VBA for quite sometime now, but I have never used this so called feature.
Can anyone tell me what the use of this option is?
Hi All,
I have been using VBA for quite sometime now, but I have never used this so called feature.
Can anyone tell me what the use of this option is?
Cheers!
Deep Dave
Basically that checks if all your variables are declared correctly and if there is any typo. But you have to declare option explicit in the beginning of your module.
Hi,
Thank you for your reply.
I always use Option Explicit and never run into an issue of incorrect variable declaration.
But I am not sure how Compile VBAProject will help me figure out incorrect declarations?
If I have a variable declared incorrectly without the Option Explicit Statement, wont it initialize it as a new variable?
There rare times auto correction doesn't always work. But the main thing is just doing the syntax check.
VBA is a scripting language, not a compiled one. In a compiled language, declaring a wrong type will raise an error and caught by the complier before run time. Not even a compiler can pick up all declarations. If you declare x is as int, but meant to be long. Both are the same type, but the range differs- any error can only picked during run time.
Last edited by AB33; 06-28-2018 at 04:01 AM.
Hi, JieJenn & AB33,
Thank you very much for your replies and clarification..
Marking the thread solved and adding reps.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks