View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dom[_3_] Dom[_3_] is offline
external usenet poster
 
Posts: 3
Default VBA Forms in Excel crashing on exit?

Jim Cone wrote:
1. Option Explicit will catch any misspelled variables.
You could think you are referring to one thing and Excel
could be seeing it as something else... lngNum vs. 1ngNum for instance.
2. It will also force you to declare all of your variables.
Undeclared variables become Variants, not always a good thing.
Also, make sure you compile the project before trying to run your code.
That can also point out problems...Debug | Compile VBAProject.

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Dom" wrote in message
...
Jim Cone wrote:


Does the workbook function on your computer but not on other computers?



No... The same error occurs on whatever computer I run it on.
What does the "Option Explicit" actually do?

Thanks for the pointer - I'll give it a try on Monday!


The code itself runs fine... The form does it's job perfectly, it's when
the excel file is actually closed that the problem occurs - Excel
crashes and auto-recovers the file. It doesn't affect the
functionability of the form but is REALLY annoying when trying to
shutdown... I'm guessing it can't happen to everyone else, but I can't
see what might cause it. Would an undeclared variable cause this?