LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Userform causes Excel to crash

Actually the multi-page control is called MultiPage1. All other controls on
any of the four pages of this control works, with the exception of the four
controls I've listed, which, along with other controls, are on the first tab
of MultiPage1. The _ob controls are Option Buttons, and the _chkbox is a
Check Box.

I've haven't tried to delete and recreate the MultiPage1 form because there
are lots of controls on this form, and it would be too difficult. I also
thought that running the code cleaner utility would, in essence, do pretty
much the same thing.

I have tried to set the value to False, with the same results.

I have added an additional Check Box control to the user form, but outside
the MultiPage form, and get the same results -- Excel crashes when I try to
set the control's value in VBA code.

I've tried deleting other controls to see if there is some sort of maximum
number of controls allowed on a multipage form, but that hasn't had any
positive impact on the problem.


"shah shailesh" wrote:

ufMain.pg1Letter_ob.Value = True


Sound pg1Letter_ob is multipage control. What about other 4 controls?

Try to set 1 instead of true.

other options :

1.You may delete the multipage control & recreate new one.
2.Check to see the form's code module with controls event's sub opens, when
you double click on control.
3.Check to see it has a problem with other systems.
4.You can email me this workbook.



Regards,
Shailesh Shah
http://in.geocities.com/shahshaileshs/
(Excel Add-ins Page)
If You Can't Excel with Talent, Triumph with Effort.




"Stu W" wrote in message
...
Yes, I've cleaned the code as suggested (both manually and using AppsPro's
code cleaner), but still have the same problem. I've isolated the problem
to
five controls on the user form. Excel will crash on *any* of the
following
statements:

ufMain.pg1Letter_ob.Value = True
ufMain.pg1Legal_ob = True
ufMain.pg1Portrait_ob = True
ufMain.pg1Landscape_ob = True
ufMain.pg1Shrink_chkbox = True

Excel does not crash if I include the following code in front of the above
statements:

Application.VBE.MainWindow.Visible = True
Application.VBE.MainWindow.Visible = False

or if I open up the VBE prior to running the code.

All code compiles cleanly, and is password protected. I've used Option
Explicit on all code. I have other option buttons and checkboxes on the
same
user form with statements as above that are not causing Excel to crash. I
am
using a multi page control on the form, and all of the above are on the
same
tab. I've tried moving these controls into and out of frames, with no
resolution to Excel crashing.

Stu W.

"shah shailesh" wrote:

Have you clean the codes as mentioned in my earlier post?

Regards,
Shailesh Shah
http://in.geocities.com/shahshaileshs/
(Excel Add-ins Page)
If You Can't Excel with Talent, Triumph with Effort.



"Stu W" wrote in message
...
Thanks, this works, and is a suitable work-around. But man, wish I
didn't
have to do this.

"shah shailesh" wrote:


If you can enable Trust access to visual basic project, this error
will
not
display.

ToolsmacrosSecuritiesTrusted Publishers Tickmark Trust access to
visual
basic project.


Regards,
Shailesh Shah
http://in.geocities.com/shahshaileshs/
(Excel Add-ins Page)
If You Can't Excel with Talent, Triumph with Effort.




"Stu W" wrote in message
...
Well, interesting work-around idea. Doesn't really solve the source
problem,
but might be a temporary solution until the real problem is
identified.

When I run the code below I get a error message:

Run-time error '1004':
Programmatic access to Visual Basic Project is not trusted

any ideas?

"shah shailesh" wrote:


Here's an update... I can run the code if I first open up the
vba
development environment and display the code. If I don't do that
first,
then
running the code causes Excel to crash. I don't have to change
anything,
I
just have to look at the code.

In this case you can add below code as under:

Public Sub ShowUFMain()
On Error GoTo ErrorRoutine

With Application.VBE.MainWindow
.Visible = True
.Visible = False
End With


ufMain.Show
ErrorRoutine:
modErrorHandle.ErrorHandling "modStartform.ShowUFMain"

End Sub


You may clean the codes by exporting each modules & userforms &
again
import
them. You may download free addins for code cleaner. Have a google
search.
You can also download my free comaddins "File Sizer" from
Com-Addins
page
of
below site.

Regards,
Shailesh Shah
http://in.geocities.com/shahshaileshs/
(Excel Add-ins Page)
If You Can't Excel with Talent, Triumph with Effort.










"Stu W" wrote in message
...
Here's an update... I can run the code if I first open up the
vba
development environment and display the code. If I don't do that
first,
then
running the code causes Excel to crash. I don't have to change
anything,
I
just have to look at the code.

THere are times when I can run the code until I compile it and
password
protect the code. Then it will cause Excel to crash.

Any ideas out there?












 
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
Excel and Word crash when I try to add a UserForm interrogativo Excel Programming 4 August 21st 17 03:49 PM
Add-In UserForm Crash Stu W Excel Programming 0 July 3rd 07 12:00 AM
Failed userform loading and cause application crash noiseash Excel Programming 1 August 25th 05 03:35 PM
Userform & crash [email protected] Excel Programming 0 March 1st 05 01:48 PM
Opening a UserForm causes a crash in the Exit procedure (Which is never called) Brent McIntyre Excel Programming 0 May 12th 04 12:37 PM


All times are GMT +1. The time now is 10:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"