View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default VBA code executes fine, but compiler throws error. Huh?


Excel 97 has a better help file than any of the later versions.
XL2000 has particularly bad help file.
Excel 97, in general, is faster than anything that came after.
However, MS has stopped releasing security fixes for Excel 97.
It is difficult to find the words to express my true feelings about xl2007.

As for your compile problem...
It sounds as if you are not using "Option Explicit" as the first line in each module.
If that is the case, you could have simply misspelled a word in your code,
leaving XL to think it is a custom Type declaration.

I saw a recent post where the same error was generated by spelling Variant as varaint.

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
I continue to have severe problems with Excel 97 SR2 crashing while
editing, compiling & running VBA.
I DO promise to upgrade soon. But meanwhile:
On relaunching Excel after its last crash, all code runs fine but the
compiler throws an error.
On selecting Debug / Compile VBAProject, error "User-defined type not
defined" appears. Nor does the compiler highlight in its usual yellow
what line is causing this supposed error.
I have three modules and they're all intact. If I deliberately make a
syntax error anywhere, execution then correctly chokes and stops on
the offending line.
Does anyone recognize this problem & how to fix it?
(And more basic Q: Why doesn't Excel's left hand know what its right
hand is doing?)
Thanks much.