Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2007

Tip: Looking for answers? Try searching our database.

Show 0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig Coope - 25 Apr 2007 11:31 GMT
Hi,

I'm trying to work out my out of stack space problem and I'm trying to
load my forms by using

form1.show 0 and
form1.show vbModeless

Neither of them work. I just get a "wrong number of arguments or
invalid property assignment" message...

I'm using Excel 97...

--
The Zero ST
Dave Peterson - 25 Apr 2007 11:59 GMT
This option was added in xl2k.  You don't get a choice in xl97.

> Hi,
>
[quoted text clipped - 11 lines]
> --
> The Zero ST

Signature

Dave Peterson

Craig Coope - 25 Apr 2007 12:07 GMT
>This option was added in xl2k.  You don't get a choice in xl97.

Looks like I'll have to find another work around :o(

I got this from MS support website

' Form1:
Sub Form_Click ()
  ' MsgBox STR$(FRE(-2))
  Unload Form1
  Form2.Show 1
End Sub

' Form2:

Sub Form_Click ()
  ' MsgBox STR$(FRE(-2))
  Unload Form2
  Form1.Show 1
End Sub
       

It says that the above will cause an out of stack space error and it
seems that my forms are the same. What would you do to the above code
to stop this. It says on the support site that instead of calling your
next form from the current form you could have one form that initially
calls all the forms....I'm not too sure how to implement this
exactly..

--
The Zero ST
Dave Peterson - 25 Apr 2007 14:41 GMT
I'm not sure what you're doing, but maybe you could create a public variable and
determine if the next userform should be shown based on what happened in the
first userform.

I put this in a General Module:

Option Explicit
Public OkToContinue As Boolean
Sub testme()
   OkToContinue = False
   UserForm1.Show
   If OkToContinue = True Then
       UserForm2.Show
   End If
End Sub

I put this behind Userform1:

Option Explicit
Private Sub CommandButton1_Click()
   Unload Me
End Sub
Private Sub CommandButton2_Click()
   OkToContinue = True
   Unload Me
End Sub
Private Sub UserForm_Initialize()
   Me.CommandButton1.Caption = "Cancel"
   Me.CommandButton2.Caption = "Ok"
End Sub

===
So each userform is called from a general module--and the public variable
determines if the next userform should be called at all.

But if you're showing lots of userforms, have you thought of using one userform
with multipages?  Kind of like what you see in the Tools|Options dialog.

> >This option was added in xl2k.  You don't get a choice in xl97.
>
[quoted text clipped - 26 lines]
> --
> The Zero ST

Signature

Dave Peterson

Craig Coope - 25 Apr 2007 21:27 GMT
>I'm not sure what you're doing, but maybe you could create a public variable and
>determine if the next userform should be shown based on what happened in the
[quoted text clipped - 33 lines]
>But if you're showing lots of userforms, have you thought of using one userform
>with multipages?  Kind of like what you see in the Tools|Options dialog.

Thanks for the info...

Basically I have coded a load of forms that inputs job start and
finish times into a sheet. Pretty simple concept and I have got it all
to work apart from this out of stack space error.

There are forms like Workers (with a list of name buttons), Start work
form (with work amount etc on it), finish work form with a big red
stop button on it! and a time lost form where users input time lost
for the job.

So the forms go like this..

Workers>Start Work>Workers>Finish Work>time lost>Workers and so on...

So at the end of each form (on commandbutton click) it says something
like

me.hide
*nextform*.show

end sub

It works fine but looks like each of these is staying in call stack
and eventually after a few hours of use it is causing an out of stack
space error. The only way to get around this error thus far has been
to exit "X" the forms and restart them (thus clearing the stack- I
assume)...

The MS supportsite said a way to get around this is to use show 0 or
show Vbmodeless (neither of which work with Excel 97).

--
The Zero ST
Dave Peterson - 25 Apr 2007 22:25 GMT
I still like the idea of using multipages -- in fact, you could make it work
like a wizard (think data|text to columns) -- so that you only enable then next
button when all the input on that page is filled out.  Then the next page is
shown and the previous page is hidden.

But I guess I don't understand why the previous suggestion didn't work.

Just a bunch of code in a general module that shows one form after another.  If
you don't need to check to see if you should continue, then you don't need that
"oktocontinue" stuff.

> >I'm not sure what you're doing, but maybe you could create a public variable and
> >determine if the next userform should be shown based on what happened in the
[quoted text clipped - 68 lines]
> --
> The Zero ST

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.