Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 188
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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!




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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!






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shortcut to switch from "fill down" to "copy" with mouse drag RJ Dake Excel Discussion (Misc queries) 3 August 13th 09 05:35 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Why does excell switch my stock symbol "ACN" to "CAN"? garron Setting up and Configuration of Excel 1 June 21st 07 02:35 AM
"Type mismatch" when I try to fill an Array variable with "+" [email protected] Excel Discussion (Misc queries) 1 April 17th 07 01:28 PM
How to programmatically control "Vary colors by point" Ambrose Excel Programming 0 October 29th 04 11:41 AM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"