Sample Excel Add-In for Coded UI Testing
This sample Add-In for Microsoft Excel is designed specifically to support Coded UI Tests of Excel worksheets that are recorded and run in Visual Studio Premium or Visual Studio Ultimate. The Add-In is created by using Visual Studio Tools for Office.
For more information about how to create an Excel Add-In, see Walkthrough: Creating Your First Application-Level Add-in for Excel or search MSDN for "Excel Add-In".
Although the Excel Add-In is not the primary subject of this documentation of the Coded UI Test Extension for Excel, a few comments may be helpful.
The important parts of this Add-In:
ThisAddIn Class - Manages the .NET Remoting channel between the ExcelUICommunicator and the Sample Coded UI Test Extension for Excel.
ExcelCodedUIAddinHelper_TemporaryKey.pfx - A security certificate for testing the Add-In.
ExcelUICommunicator Class - This class implements the IExcelUICommunication interface.
ThisAddIn Class
Most of this class is actually generated by Visual Studio Tools for Office in the ThisAddIn.Designer.cs file when you create your Excel Add-In project.
The members that you must implement are the event handlers: ThisAddIn_Startup() and ThisAddIn_Shutdown(). Their purpose is to initialize or close the .NET Remoting channel that is used by the ExcelUICommunicator.
ExcelCodedUIAddinHelper_TemporaryKey.pfx
This file contains a temporary security certificate that is generated by Visual Studio Tools for Office and gives the Add-In assembly permission to operate in the Excel process for testing the Add-In and extension. You should delete this certificate and either create a new one in the Signing tab of the project Properties window, or attach your own testing certificate.
ExcelUICommunicator Class
This class implements the IExcelUITestCommunication interface and gets the requested UI information from the Excel object model. For more information, see Sample Excel Communicator Interface.
See Also
Tasks
Walkthrough: Creating Your First Application-Level Add-in for Excel
Concepts
Extending Coded UI Tests and Action Recordings to Support Microsoft Excel
Other Resources
Getting Started (How Do I in Visual Studio Tools for Office)