Excel Automation With Coded UI Test

The three matrix that I have validated and shared are 

  1. Excel 2013 X VS 2013 Update2
  2. Excel 2010 X VS 2013 Update2
  3. Excel 2010 X VS 2012

Install Instructions:

  1. Hit F5 on the solution. That installs the Excel Add-In
  2. Copy Microsoft.VisualStudio.Test.Sample.UI.dll to UITestExtensionPackages and PrivateAssemblies
  3. Copy Microsoft.VisualStudio.Test.Sample.UI.Excel.Communication.dll to PrivateAssemblies. 

 Important Points:  

  1. In case of VS 2013, you need update 2 to get things working
  2. Donot use two plugins at once. Pick the required set and ensure that only one addin is loaded into excel. To be sure go to Excel -> File -> Options -> Add Ins -> Manage combobox (Com Add ins) -> Go. Here remove the CodedUIAddinHelper. Open the appropriate solution from above and hit F5. This will launch excel and also loads the plugin. Subsequent launches of excel can be done from anywhere (taskbar etc)
  3. I have implemented Value as a writable properly that can be handcoded.

 

Note:

  • Path to UITestExtensionPackages will usually be something like C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\12.0\UITestExtensionPackages 
  • Path to PrivateAssemblies will usually be something like C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies

ExcelPlugins.zip