VSTO Excel 2007 Workbook - main form

Posted on 2011-04-20
Last Modified: 2013-11-10

In VSTO 2010 is it possible to have a main form that opens when the project runs?
Question by:murbro
    LVL 35

    Expert Comment

    by:Miguel Oz
    Just to clarify by Main form your form is in charge of all user interaction and used to access to Excel workbook.
    If that is the case then the answer is no. In a typical VSTO application Excel is the main MDI window, you can call from the ribbon any forms you require.
    But if what you need is just a login form then that is feasible.

    Author Comment

    Hi. I just want a Windows form to pop up when the application runs. Would I initiate this in some event?
    LVL 35

    Accepted Solution

    You can do that in ThisWorkbook_Startup event:
    On your Vsto project find: ThisWorkbook.vb
    1. Create a new field variable:
    Dim myFrm As MyForm;
    2. on the startup event (ThisWorkbook_Startup)
    myFrm = new MyForm()

    where MyForm is your custom form.
    Link below shows a sample VSTO project:

    Author Closing Comment

    great answer,. Thanks

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    728 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

    18 Experts available now in Live!

    Get 1:1 Help Now