ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programmatically switch off "Variable declaration reqiured" in VBE? (https://www.excelbanter.com/excel-programming/318931-programmatically-switch-off-variable-declaration-reqiured-vbe.html)

Alan

Programmatically switch off "Variable declaration reqiured" in VBE?
 

Hi All,

Is there a way to programmatically switch off the 'Variable
Declaration Required' option in the VBE (VBE - Tools - Options -
Editor - Require Variable Declaration)?

I am using Excel 2000 - fully patched.

Thanks in advance,

Alan.



AA2e72E

Programmatically switch off "Variable declaration reqiured" in VBE
 
The effect of that setting is to wtite this line in any new modul or class:

Options Explicit

If you delete this line, you will not have to declare your variables.

"Alan" wrote:


Hi All,

Is there a way to programmatically switch off the 'Variable
Declaration Required' option in the VBE (VBE - Tools - Options -
Editor - Require Variable Declaration)?

I am using Excel 2000 - fully patched.

Thanks in advance,

Alan.




Bob Phillips[_6_]

Programmatically switch off "Variable declaration reqiured" in VBE?
 
But why would you? There are no benefits that I know of, and plenty of
disadvantages.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Alan" wrote in message
...

Hi All,

Is there a way to programmatically switch off the 'Variable
Declaration Required' option in the VBE (VBE - Tools - Options -
Editor - Require Variable Declaration)?

I am using Excel 2000 - fully patched.

Thanks in advance,

Alan.





Rob van Gelder[_4_]

Programmatically switch off "Variable declaration reqiured" in VBE?
 
The advantage, of course, is that you can combine it with the POWER of "On
Error Resume Next" and have error free code !


But seriously...
After so many versions of Excel, Require Variable Declaration is still
unticked by default <sigh.

Working without Option Explicit is begging for trouble.
It really shouldn't be an optional at all.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bob Phillips" wrote in message
...
But why would you? There are no benefits that I know of, and plenty of
disadvantages.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Alan" wrote in message
...

Hi All,

Is there a way to programmatically switch off the 'Variable
Declaration Required' option in the VBE (VBE - Tools - Options -
Editor - Require Variable Declaration)?

I am using Excel 2000 - fully patched.

Thanks in advance,

Alan.







Bob Phillips[_6_]

Programmatically switch off "Variable declaration reqiured" in VBE?
 

"Rob van Gelder" wrote in message
...
The advantage, of course, is that you can combine it with the POWER of "On
Error Resume Next" and have error free code !



Error free only in the respect that the errors aren't reported!



Rob van Gelder[_4_]

Programmatically switch off "Variable declaration reqiured" in VBE?
 
Indeed. I was making a joke - I'm funnier in real life - really!

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bob Phillips" wrote in message
...

"Rob van Gelder" wrote in message
...
The advantage, of course, is that you can combine it with the POWER of
"On
Error Resume Next" and have error free code !



Error free only in the respect that the errors aren't reported!





Bob Phillips[_6_]

Programmatically switch off "Variable declaration reqiured" in VBE?
 
I know Rob, my point was really re-emphasising to the OP who might have
thought that it would be useful :-)

Bob

"Rob van Gelder" wrote in message
...
Indeed. I was making a joke - I'm funnier in real life - really!

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bob Phillips" wrote in message
...

"Rob van Gelder" wrote in

message
...
The advantage, of course, is that you can combine it with the POWER of
"On
Error Resume Next" and have error free code !



Error free only in the respect that the errors aren't reported!








All times are GMT +1. The time now is 05:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com