VSTO Excel 2007 Workbook - main form

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

In VSTO 2010 is it possible to have a main form that opens when the project runs?
Question by:Murray Brown
  • 2
  • 2
LVL 36

Expert Comment

by:Miguel Oz
ID: 35437422
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

by:Murray Brown
ID: 35440420
Hi. I just want a Windows form to pop up when the application runs. Would I initiate this in some event?
LVL 36

Accepted Solution

Miguel Oz earned 2000 total points
ID: 35451502
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

by:Murray Brown
ID: 35456776
great answer,. Thanks

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Integration Management Part 2

850 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