+ Reply to Thread
Results 1 to 9 of 9

issue with a userform not hiding, the commands are right though

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    issue with a userform not hiding, the commands are right though

    here is the code table from userform6

    'Control Budget" userform button
    Please Login or Register  to view this content.
    and here is the code for the COS button

    Please Login or Register  to view this content.
    here is the snippet of code from "Grand10"

    Please Login or Register  to view this content.
    if i turn off me.hide in my buttons then the userform does not close.

    if i change the code above for this, then my error is "run time error 402 - must close or hide topmost modal form first"

    Please Login or Register  to view this content.
    i do have a userform4 that closes (runs before the above code) properly, so not sure what it is complaining about.

    thoughts anyone?

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: issue with a userform not hiding, the commands are right though

    It's really hard to debug things like this without the workbook as it typically means you have got a chain of code that is wrong.

    Why are you trying to hide a form that appears to have already been hidden by the earlier button code?
    Rory

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: issue with a userform not hiding, the commands are right though

    cause its not hiding. let me upload a workbook with the code:

    so i am attaching two workbooks. the parent (SheetsForConstructionAndImportingIntoViewpoint - FROZEN - for upload.xlsm) and the target workbook (Bay Main House CO6 - for upload.xlsx)

    open up the parent, go to "navigation" sheet, click on "Import sheets"

    from userform4, select "Navigate" and then click to the target workbook (where ever you saved it).

    then userform6 opens (and never closes)

    can you work with this?

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: issue with a userform not hiding, the commands are right though

    Before I do, did you by any chance turn screenupdating off before showing the form?

  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: issue with a userform not hiding, the commands are right though

    yes a couple of lines before i show userform6. is that a problem?

  6. #6
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: issue with a userform not hiding, the commands are right though

    i commented it out, doesnt appear to fix the issue though

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: issue with a userform not hiding, the commands are right though

    Try explicitly turning it on before showing the form. If that doesn't help, I'll have a look when I have a minute.

  8. #8
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: issue with a userform not hiding, the commands are right though

    thanks rorya, im pulling my hair out and i don't have much left.

    i explicitly turned it on and reran the code. no luck.

  9. #9
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: issue with a userform not hiding, the commands are right though

    so i finally figured it out. i replaced all the me.hide and userform#.hide with unload, like so:

    Please Login or Register  to view this content.
    that made the code work. don't know why though.

    thoughts?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Hiding a column issue
    By warehouseman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2014, 09:16 AM
  2. adding click commands to a userform label
    By moosemaster23 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2013, 05:57 AM
  3. Macro Recording Chart Format commands missing all important commands!!!!
    By nounours in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2013, 09:20 PM
  4. Disable hiding of menu commands tab in add-in ribbon
    By iyzr88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2011, 10:34 AM
  5. Issue with Hiding Columns
    By chris100 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2006, 06:17 PM
  6. [SOLVED] Excel Tends to access network when I issue commands
    By ch in forum Excel General
    Replies: 0
    Last Post: 12-27-2005, 04:40 AM
  7. Issue Commands To a DOS Window
    By Andibevan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2005, 01:05 PM

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