Group:  Microsoft Excel ยป microsoft.public.excel.crashesgpfs
Thread: Excel 2007 SP1 - Faulty 'compile error' message

Excel 2007 SP1 - Faulty 'compile error' message
Ron West 11/10/2008 2:05:02 PM
When altering XL2007 VBA code in break mode, I often have to declare new
variables (eg with datatypes Boolean and Date) and I frequently get a faulty
'compile error' message saying that there is a "Duplicate Declaration in
Current Scope" when trying to continue.

There is no way out of it except to halt the program and completely restart
it from the beginning.

And, there absolutely definitely isn't a duplicate declaration because I can
compile and run the code with no alterations once I have stopped the code
(and wasted my previous run).
RE: Excel 2007 SP1 - Faulty 'compile error' message
ShaneDevenshire 11/11/2008 4:20:00 AM
Hi,

First - to have to rerun all the step again is tedious so you should insert
a breakpoint at the location where you were force to stop.

Second - if you declare a variable during execution Excel may require you to
restart, regardless of what the message says.

Third - you might be able to reduce the problem by setting Option Explicit
at the top of the module.

There is some info here:

http://support.microsoft.com/kb/212673/en-us

--
Thanks,
Shane Devenshire


"Ron West" wrote:

[Quoted Text]
> When altering XL2007 VBA code in break mode, I often have to declare new
> variables (eg with datatypes Boolean and Date) and I frequently get a faulty
> 'compile error' message saying that there is a "Duplicate Declaration in
> Current Scope" when trying to continue.
>
> There is no way out of it except to halt the program and completely restart
> it from the beginning.
>
> And, there absolutely definitely isn't a duplicate declaration because I can
> compile and run the code with no alterations once I have stopped the code
> (and wasted my previous run).
RE: Excel 2007 SP1 - Faulty 'compile error' message
Ron West 11/11/2008 9:40:03 AM
Option Explicit was already declared...

I don't remember having this much trouble with earlier versions of Excel...


"ShaneDevenshire" wrote:

[Quoted Text]
> Hi,
>
> First - to have to rerun all the step again is tedious so you should insert
> a breakpoint at the location where you were force to stop.
>
> Second - if you declare a variable during execution Excel may require you to
> restart, regardless of what the message says.
>
> Third - you might be able to reduce the problem by setting Option Explicit
> at the top of the module.
>
> There is some info here:
>
> http://support.microsoft.com/kb/212673/en-us
>
> --
> Thanks,
> Shane Devenshire
>
>
> "Ron West" wrote:
>
> > When altering XL2007 VBA code in break mode, I often have to declare new
> > variables (eg with datatypes Boolean and Date) and I frequently get a faulty
> > 'compile error' message saying that there is a "Duplicate Declaration in
> > Current Scope" when trying to continue.
> >
> > There is no way out of it except to halt the program and completely restart
> > it from the beginning.
> >
> > And, there absolutely definitely isn't a duplicate declaration because I can
> > compile and run the code with no alterations once I have stopped the code
> > (and wasted my previous run).
Re: Excel 2007 SP1 - Faulty 'compile error' message
"Shane Devenshire" <shanedevenshire[ at ]sbcglobal.net> 12/28/2008 8:20:27 PM
Hi,

There is virtually nothing new in VBA in 2007, so this is pretty much how
things were in previous versions. I haven't actually seen this problem yet
in 2007 so I can't make any comments beyond those I already made.

Cheers,
Shane Devenshire

"Ron West" <RonWest[ at ]discussions.microsoft.com> wrote in message
news:686C54E2-1945-44DF-9D2C-87F47D87F3FC[ at ]microsoft.com...
[Quoted Text]
> Option Explicit was already declared...
>
> I don't remember having this much trouble with earlier versions of
> Excel...
>
>
> "ShaneDevenshire" wrote:
>
>> Hi,
>>
>> First - to have to rerun all the step again is tedious so you should
>> insert
>> a breakpoint at the location where you were force to stop.
>>
>> Second - if you declare a variable during execution Excel may require you
>> to
>> restart, regardless of what the message says.
>>
>> Third - you might be able to reduce the problem by setting Option
>> Explicit
>> at the top of the module.
>>
>> There is some info here:
>>
>> http://support.microsoft.com/kb/212673/en-us
>>
>> --
>> Thanks,
>> Shane Devenshire
>>
>>
>> "Ron West" wrote:
>>
>> > When altering XL2007 VBA code in break mode, I often have to declare
>> > new
>> > variables (eg with datatypes Boolean and Date) and I frequently get a
>> > faulty
>> > 'compile error' message saying that there is a "Duplicate Declaration
>> > in
>> > Current Scope" when trying to continue.
>> >
>> > There is no way out of it except to halt the program and completely
>> > restart
>> > it from the beginning.
>> >
>> > And, there absolutely definitely isn't a duplicate declaration because
>> > I can
>> > compile and run the code with no alterations once I have stopped the
>> > code
>> > (and wasted my previous run).

Home | Search | Terms | Imprint
Newsgroups Reader