+ Reply to Thread
Results 1 to 8 of 8

Open userform and hide active workbook only

  1. #1
    Registered User
    Join Date
    02-22-2013
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Open userform and hide active workbook only

    Hi All,

    I have something I think is very simple. I'll preface by saying it's been about 10 years since I've used Excel VB and I'm extremely rusty. I built a very simple userform that we're calling a "simulator" that retrieves all its contents from a workbook. The form is primarily made up of comboboxes that is populated with values taken from the spreadsheet. The values are used in a complex formula and the result is displayed back on the form as a chart with text feedback. So the workbook is doing all the work, the sheet is just presenting a user-friendly interface and hiding all the complexity behind it.

    I figured it would be easy enough to hide the active workbook and display only the form but it's not turning to be so simple. The trouble I'm having is I can't figure out how to close the active workbook because it's the brains for the form. I also need to consider that users may have other spreadsheets open and I don't want to interfere with those spreadsheets.

    I can't figure it out. What can I do?

  2. #2
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Open userform and hide active workbook only

    Just hiding the sheet that contains data related to form, doesn't work?

  3. #3
    Registered User
    Join Date
    02-22-2013
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Open userform and hide active workbook only

    I tried that. The form is retrieving data from 4 worksheets in the workbook. I get a message that I have to leave at least one sheet open. I want the form to appear as an executable.

  4. #4
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Open userform and hide active workbook only

    It isn't possible... However, add a blank sheet to leave it visible and hide the others 4.

  5. #5
    Registered User
    Join Date
    02-22-2013
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Open userform and hide active workbook only

    There's no other way to hide the entire worksheet yet have the formulas available for the userform? I was hoping to avoid having the spreadsheet open at all.

  6. #6
    Registered User
    Join Date
    02-22-2013
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Open userform and hide active workbook only

    I'm going to add a blank sheet then have it minimize upon opening.

  7. #7
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Open userform and hide active workbook only

    Hurrah I got it.... Paste this code in your form's code module:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-22-2013
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Open userform and hide active workbook only

    Thanks, I was hopeful. It seems the code hides the content for the comboboxes, as a result the form doesn't work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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