+ Reply to Thread
Results 1 to 8 of 8

VBA Form, hidden Workbook

  1. #1
    Registered User
    Join Date
    01-21-2014
    Location
    denver
    MS-Off Ver
    Excel 2010
    Posts
    3

    VBA Form, hidden Workbook

    Hello,

    i have a vba form which has many dataconnections to different sheets ot its workbook.
    When i open the workbook the form shows automatically up.

    What i want now and where I've problems:

    The workbook (Excel) should not be visible when the form is displayed and teh user should not be able to enter the workbook or any sheets of it.
    He should not be able to see the content of the workbook (never)

    If the user has another (different) workbook opened this one should not be influenced in any way (The user should still be able to work with it , parallel 2 or more workbooks).

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA Form, hidden Workbook

    You could do something like the following in the userform. Move the code from Sub StartUp in the UserForm initialize event and include the FindWindow function as a private function in the form:
    Please Login or Register  to view this content.
    Don't forget to unhide when you close...

  3. #3
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: VBA Form, hidden Workbook

    try this solution.
    Attached Files Attached Files
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  4. #4
    Registered User
    Join Date
    01-21-2014
    Location
    denver
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: VBA Form, hidden Workbook

    But if this form open I'm not aqble to open another excel document. since the form is modal.
    Do youo have a workaround for that?

  5. #5
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA Form, hidden Workbook

    Use
    Please Login or Register  to view this content.
    to open the userform

  6. #6
    Registered User
    Join Date
    01-21-2014
    Location
    denver
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: VBA Form, hidden Workbook

    This is the code from the xls from xlbiznes

    Private Sub Workbook_Open()
    'make the workbook invisible and display the form
    ActiveWorkbook.Application.Visible = False
    UserForm1.Show
    End Sub

    if you make this vbModeless then you get the following behaviour:
    If you open another xls and close it then you can see the xls which was set to visible false first

  7. #7
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA Form, hidden Workbook

    The only comment I have is the code in the workbook is setting the Application hidden - which will hide all open workbooks in that instance of Excel.

    Try using the code I posted - that only hides the Workbook window containing the code. You will still have the issue of the modal userform, but you can just show it modelessly...

    The mods here might like you to edit your post and include code tags around the code listing. This is simply a matter of editing the post, highlighting the code and clicking the '#' button on the toolbar...

  8. #8
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: VBA Form, hidden Workbook

    @aristodemus ,

    sorry about the previous file, this is the updated one and it behaves the way you wanted.

+ 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. Primary workbook is hidden when name of hidden workbook changes
    By excel_vb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2010, 08:05 PM
  2. Form Hidden ID's
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2009, 11:34 AM
  3. VBA Function Vlookup data from Hidden sheet in hidden workbook
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2008, 11:22 PM
  4. Hidden columns NOT HIDDEN on shared workbook
    By Excel Kurt in forum Excel General
    Replies: 2
    Last Post: 07-11-2007, 03:16 PM
  5. form that calls hidden worksheets
    By Monish in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-14-2005, 01:05 AM

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