+ Reply to Thread
Results 1 to 27 of 27

Excel vba user form- open directly to user form not worksheet

  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Excel vba user form- open directly to user form not worksheet

    I have a desk top short cut set up so the users can go directly to the spreedsheet. But I am attempting to keep users from the spreedsheet and go directly to the userform. The below code takes them to spreedsheet 3, how do I change this so they go directly to the user form.

    I have attached my active workbook. You will also note that I have disabled the X so they must use the Exit button.

    Thanks for any help all is appreciated!

    Private Sub Workbook_Open()
    Worksheets("Sheet3").Activate
    frmINVENTORY.Show
    End Sub

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Excel vba user form- open directly to user form not worksheet

    Maybe this,

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Attempted that but it still goes to sheet 3. A security warning shows at the top of the spreadsheet (macros have been disabled choose options etc.. Could this be the hold up?

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Excel vba user form- open directly to user form not worksheet

    How does the above code go to sheet 3 is beyond me. Have you enabled macros in the options?

  5. #5
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    I just disabled the Security alert macro but it still goes to sheet 3.

  6. #6
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Excel vba user form- open directly to user form not worksheet

    How does it still go to sheet 3 if the code does not say so? Post a workbook please.

  7. #7
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Sorry, here it is with changes you suggested.

  8. #8
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Excel vba user form- open directly to user form not worksheet

    If it is saved on sheet 3 then it will open to sheet 3. Otherwise , no code is directing anything to sheet 3???

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    Hide the application.
    If posting code please use code tags, see here.

  10. #10
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Nori,

    My attempt has failed. Please tell me what I did wrong. Thank you!

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    What did you try?

    I don't see anything in the code that would set Application.Visible to False.

  12. #12
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Please advise as to what can be removed an where to add Application.Visible to False

    Please Login or Register  to view this content.

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    Add it to the code that runs when the workbook opens.

  14. #14
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Norie,

    Attempted that but I must have screwed it up. Also tried...

    Sub Auto_Open()
    Userform1.show
    End Sub

    No luck!

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    You don't have a UserForm1 so I don't know what this code is meant to do, mind you it'll probably never be executed.
    Please Login or Register  to view this content.
    You should set Application.Visible to False here, before you show the userform.
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Still going to sheet 3 on the load up

  17. #17
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    Why aren't you trying what I've suggested?

    This code goes in the ThisWokbook module, not the userform module.
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Sorry not a programmer had no idea where that code was to go. So I deleted it from the userform and added to "ThisWorkbook". Sad to say it still is not working. Had high hopes though!

  19. #19
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    Strange because when I open the workbook I can't see Excel at all, it's just not visible.

  20. #20
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Could there be something in the Trust center that is stopping it from going straight to the user form?

  21. #21
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    Is the userform opening?

  22. #22
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    It opens to sheet 3 then I have to click on the Security alert macro "enable this content" to get the Userform to open. If I change the macro to not show that alert it just goes straight to sheet 3 and the user has no way to get to the Userform.

  23. #23
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    So you've set security so macros won't actually run?

  24. #24
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Current setting is

    Disable all macros with notification (the user can get to the Userform when they click on options and enable this content.

    If I change it to Disable all macros without notification the user can't get to the Userform.

  25. #25
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    How about enabling all macros?

  26. #26
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Excel vba user form- open directly to user form not worksheet

    Yes, you are a genius! How do I access the code, now I do have a backup that I have not enabled all macros so I can make an updates to that but I thought there may be a way for me to access this one........

  27. #27
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: Excel vba user form- open directly to user form not worksheet

    The easiest way might be to stop your Exit Program button closing Excel.

    Have it make Excel visible again instead

    Please Login or Register  to view this content.

+ 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