Option Explicit defaults to ON in Excel 2003
Someone has passed a rather large s/s to me today to make some mods to, but for some reason "option explicit" is on, even though there is no "option explicit" anywhere in the code and "Tools/Options/Require Variable Declaration" is unchecked. The problem being, within the masses of code I'm faced with hundreds of variable declarations to route out before I can run the s/s, and it needs to be back for the morning! :mad:
Any suggestions would be greatly appreciated!
Re: Option Explicit defaults to ON in Excel 2003
Welcome to the Forums.
Since you received the SS they may have had the option checked and added Option Explicit somewhere in one of the modules or classes. Do a Find for "Option Explicit" and comment it out. Although I dont recommend doing it this way to avoid the errors, if time is an issue then I'd say just for now and then go back and fix it after. Who knows you just might find some issues when you fix the variable declarations. ;)
Re: Option Explicit defaults to ON in Excel 2003
No joy I'm afraid - there were a handfull of forms with them, but none in any of the modules or anywhere else for that matter - did search "Entire Project"... :confused:
Re: Option Explicit defaults to ON in Excel 2003
Did you look behind the Sheets too? When you run the macros it should error at the offending line or module/sheet/class etc.
Re: Option Explicit defaults to ON in Excel 2003
It errors at the first sub of the first module - when ithits the first variable name. All variables should be type variant, but something has globally changed after a few years to stop this..... I just can't figure out what they've done to it!
Re: Option Explicit defaults to ON in Excel 2003
Can you attach the workbook or some of the code at least?