ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   New PC and my code doesn't run... (https://www.excelbanter.com/excel-programming/435654-new-pc-my-code-doesnt-run.html)

Chris Gorham

New PC and my code doesn't run...
 
Hi,

I have a new PC & I'm running code in a workbook that previously was
fine...Excel 2003 enviroment as before.
Now the VBA editor is kicking out an error for every variable that hasn't
been dimensioned.
Ok. I've been lazy and not inserted an Option Explicit to force dimensioning
in this code in the past.
Strangely though other code works fine and a brief test with a 3 line
routine worked ok...
Anybody got any suggestions as to what may have happened...

Chris

Bernard Liengme[_3_]

New PC and my code doesn't run...
 
In the VB Editor, open the Tools | Options menu.
Is the second item "Required Variable Declaration" checked ? This is
equivalent to Option Explicit
Try unchecking it
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Chris Gorham" wrote in message
...
Hi,

I have a new PC & I'm running code in a workbook that previously was
fine...Excel 2003 enviroment as before.
Now the VBA editor is kicking out an error for every variable that hasn't
been dimensioned.
Ok. I've been lazy and not inserted an Option Explicit to force
dimensioning
in this code in the past.
Strangely though other code works fine and a brief test with a 3 line
routine worked ok...
Anybody got any suggestions as to what may have happened...

Chris




Gary''s Student

New PC and my code doesn't run...
 
From the VBA Menu:

Tools Options... Editor and clear the require variable declaration
checkbox
--
Gary''s Student - gsnu200908


"Chris Gorham" wrote:

Hi,

I have a new PC & I'm running code in a workbook that previously was
fine...Excel 2003 enviroment as before.
Now the VBA editor is kicking out an error for every variable that hasn't
been dimensioned.
Ok. I've been lazy and not inserted an Option Explicit to force dimensioning
in this code in the past.
Strangely though other code works fine and a brief test with a 3 line
routine worked ok...
Anybody got any suggestions as to what may have happened...

Chris


Tim Williams[_2_]

New PC and my code doesn't run...
 
I belive all that option does is automatically put "Option Explicit" at the
top of any *new* modules.
It doesn't enforce declariation directly.

Tim

"Bernard Liengme" wrote in message
...
In the VB Editor, open the Tools | Options menu.
Is the second item "Required Variable Declaration" checked ? This is
equivalent to Option Explicit
Try unchecking it
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Chris Gorham" wrote in message
...
Hi,

I have a new PC & I'm running code in a workbook that previously was
fine...Excel 2003 enviroment as before.
Now the VBA editor is kicking out an error for every variable that hasn't
been dimensioned.
Ok. I've been lazy and not inserted an Option Explicit to force
dimensioning
in this code in the past.
Strangely though other code works fine and a brief test with a 3 line
routine worked ok...
Anybody got any suggestions as to what may have happened...

Chris






Sam Wilson

New PC and my code doesn't run...
 

In the VBE: Tools/Options and untick "Require Variable Declaration"

Sam

"Chris Gorham" wrote:

Hi,

I have a new PC & I'm running code in a workbook that previously was
fine...Excel 2003 enviroment as before.
Now the VBA editor is kicking out an error for every variable that hasn't
been dimensioned.
Ok. I've been lazy and not inserted an Option Explicit to force dimensioning
in this code in the past.
Strangely though other code works fine and a brief test with a 3 line
routine worked ok...
Anybody got any suggestions as to what may have happened...

Chris



All times are GMT +1. The time now is 12:22 PM.

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