Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Bug in Excel VBA compiler?

Today a mysterious problem arose after making some edits to a VBA project.
After adding a few new lines of code, the compiler will no longer compile
(and run) my subroutine. The compiler reports "Compile error: Constant
expression required" on a line where I reference a Public Enum.

The enumeration is properly declared in the (General) (Declarations) section
of the same module. When editing on the same line of the error, the
enumeration is recognized by the editor as an option when typing.

The updates to the new code today have nothing to do with the enumeration or
the line in which the error is occurring. After REMing out all new code
from today, the error still persists even though it all worked fine
yesterday. If I REM out the line with the error, the compiler stops on the
next line with a reference to a public enumeration.

I experienced this same problem (with a different project) about a month
ago. After searching the KB and the Internet to no avail, the problem
mysteriously went away. Of course, I wasted half a day trying to figure it
out.

Then I remembered that the last time I copied all my code from the problem
subroutine into a new subroutine. I then renamed both subroutines so the
new one is named with the original name. I performed this same procedure
today, and poof! - the problem is gone.

I'm curious if anyone else has encountered this problem and if there is a
reason why it occurs. I have never been able to locate any KB article on
this. Obviously, this sort of problem is very frustrating because the code
is correct.

Any insight will be greatly appreciated.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Bug in Excel VBA compiler?

Hi

Thanks for your experience sharing.
Commonly it is hard to say what is going on without a reproduce scenario.
But I think you would try to create a new Excel and copy/paste all the code
to see if that works for you if you have the problem again

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

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
Compiler Error - Not an Appropriate Name pallaver Excel Discussion (Misc queries) 1 July 16th 08 02:20 AM
Excel Compiler Steve-in-austin Excel Discussion (Misc queries) 2 June 8th 06 06:44 PM
Excel compiler and Excel password A-Design Excel Programming 2 September 30th 04 05:31 PM
VBA Compiler Error Cause Excel to Crash MWE[_12_] Excel Programming 3 January 26th 04 02:22 AM
Excel Compiler - is one available? John Baker Excel Programming 11 October 25th 03 01:33 PM


All times are GMT +1. The time now is 06:59 AM.

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"