+ Reply to Thread
Results 1 to 11 of 11

Opening a userform while another is open

  1. #1
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Opening a userform while another is open

    Hello all!
    Not sure if the title really says what I want.

    Anyways, I have a userform that allows me to edit an order. When I edit the order and click "done" (commandbutton) the code changes the order by moving what I typed in the textbox to a cell on a worksheet.

    With this userform (and some others in my workbook) I would like to open another userform that has an animated gif in a webbrowser stating that excel is processing, while the first userform is running its code. When the code is finished, I want the second userform (processing) to go away.

    I have already tried opening as "vbmodeless", but it says that I cant do that!

    Any suggestions?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Opening a userform while another is open

    Hello rbyrd023,

    While the first UserForm is running, hide it and then show the second form. Once the first form is done then close the second form and show the first.

    In UserForm1
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Opening a userform while another is open

    Thank you for the response. I just tried that, but the first userform will not execute the code while the second form is running.

    Here is the code I have on that command button:
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Opening a userform while another is open

    Hello rbyrd023,

    You have unloaded the form and then tried to close it. Because the second for is already closed, the SendKeys will close whichever window has the focus. I removed the SendKeys from the code.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Opening a userform while another is open

    Ok tried that and still have the same result.

    while frmtest is open, the remaining code will not run. I have to close frmtest manually for the rest of the code to start.

    This is really bothering me....... lol I know it can be done!

    Thank you again for your help!

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Opening a userform while another is open

    Hello rbyrd023,

    You should post your workbook for review.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Opening a userform while another is open

    From what you describe I really can't see why your code should take enough time to need the warning form
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  8. #8
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Opening a userform while another is open

    Ok for some reason now the vbmodeless is working, but the gif image in the webbrowser doesnt show, just a white image.

    I'll load the sample workbook, but because there is not alot of data on it, it runs very fast.

    The processing window doesn't stay up long enough.

    My program is very large and it can take some time to run code. This is just one of the pages that I want to do this to. Some others have a large amount of processing.
    Attached Files Attached Files

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Opening a userform while another is open

    Hello rbyrd023,

    I works on my system. I had to change the path to the gif file to something on my system but it works. It maybe because I am running Windows XP and using Excel 2003.

  10. #10
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Opening a userform while another is open

    I wonder if its because I am using an animated gif?

    I will change the file and try it!

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Opening a userform while another is open

    I'm not sure if this is correct, but when you start the second form it's code starts to run, that will stop the original code until completed. As I said earlier, I can't see why you should need a progress form for simply writing data to the sheet. I think your time would be better used to improve the efficiency of the code by finding out why it takes so long to run

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1