Having a userform open upon opening the program

Posted on 2006-04-10
Last Modified: 2010-04-17

I created a userform in Excel VBA, but don't know how to get it to open when the program opens. Do I add some code to ThisWorkbook, or to Sheet1?

Hope you can help.

Question by:Mike_DM
    LVL 1

    Accepted Solution

    If you put the following code in the same module as any macros it should automatically open the form when the workbook opens

    Sub Auto_Open()
    End Sub
    LVL 2

    Expert Comment

    Private Sub  App_WorkbookOpen(ByVal Wb As Workbook)
        Application.Windows.Arrange xlArrangeStyleTiled
    End Sub

    Expert Comment

    Hi, the first (and simpler) code worked, and the second didn't. However, I had to put the code in a new module -- the rest of the code sits in the userform object.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    Title # Comments Views Activity
    no14 challenge 14 46
    Simple (?) problem getting Rainbow Folders to run 6 73
    VBA color chart bars 12 50
    array6 challenfge 6 48
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    A short article about problems I had with the new location API and permissions in Marshmallow
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now