ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userforms & Excel 2002 Crashes (https://www.excelbanter.com/excel-programming/443336-userforms-excel-2002-crashes.html)

Steve[_119_]

Userforms & Excel 2002 Crashes
 
Hello

I'm hitting an issue with Excel 2002 which I believe may be due to the
way that I'm defining & using UserForm objects.

Lets say I define a new form & call it frmMyForm

then within a button macro, if I use:

Dim myFrm as frmMyForm
set myFrm=new frmMyForm


I'm finding that Excel will periodically crash, or that you can't
simply right click other buttons to access their macros.

I believe that I'm disposing the form objects correctly as I can see
the Terminate macro being called when the form is closed, the purpose
of which I use to set any persisted object reference to nothing.

The reason why, I'm using the Form definition as a type rather than a
predefined object, is that I can simply create several instances of
the same form which can be open at the same time each persisting
different data sets.so the user perssing the button macro several
times can have the same form window opened several times and use each
window to display different data sets.

Are there any known issues with using this form (excuse the punn) of
invokation ? Or even with embedding Scripting.Dictionary, and 2d/3d
variant arrays within a Form Class code ?


Thanks in advance,


Steve.


Harald Staff[_2_]

Userforms & Excel 2002 Crashes
 
Hi Steve

Dim myFrm as frmMyForm
set myFrm=new frmMyForm


I've used this way of writing for many years and many users. No problems
whatsoever.

Note that the debugger doesn't go too many levels down. If your form's
initialize or load or activate code does or calls something that errs, it
will halt on places like Set myFrm = new, and not take you down to where the
real problem is.

HTH. Best wishes Harald


"Steve" wrote in message
...
Hello

I'm hitting an issue with Excel 2002 which I believe may be due to the
way that I'm defining & using UserForm objects.

Lets say I define a new form & call it frmMyForm

then within a button macro, if I use:

Dim myFrm as frmMyForm
set myFrm=new frmMyForm


I'm finding that Excel will periodically crash, or that you can't
simply right click other buttons to access their macros.

I believe that I'm disposing the form objects correctly as I can see
the Terminate macro being called when the form is closed, the purpose
of which I use to set any persisted object reference to nothing.

The reason why, I'm using the Form definition as a type rather than a
predefined object, is that I can simply create several instances of
the same form which can be open at the same time each persisting
different data sets.so the user perssing the button macro several
times can have the same form window opened several times and use each
window to display different data sets.

Are there any known issues with using this form (excuse the punn) of
invokation ? Or even with embedding Scripting.Dictionary, and 2d/3d
variant arrays within a Form Class code ?


Thanks in advance,


Steve.




All times are GMT +1. The time now is 05:23 AM.

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