VSTO & VBA – How to troubleshoot Excel memory and performance problems caused by inefficient code loops

When working with Excel, a developer sometimes has to search, read or write some cell values and these operations are usually done inside repetitive loop structures. Everything seems to work fast enough for small input files, but once we scale up the design, things can complicate and the end-user experience is severely affected. On the other hand, the developer takes…

5

VBA – How to Find and Edit the Office 2003 legacy CommandBars and menus in Office 2010 (add, remove, edit controls in ‘Menu Commands’ group from Add-Ins tab)

Today I am going to show you how to work with legacy CommandBar controls in Office 2010. Let’s suppose you are in the following scenario: –  you have created a DOT template in Office 2003;-  a couple of macros have been added to the VB project; –  and you also found it convenient to insert a custom menu item to allow end-users / colleagues to easily…

2

VBA – How to programmatically enable access to the VBA object model using macros

    Under certain circumstances a programmer may need to access the VB object model for an Office application and interact with its VBIDE interface (clean-up missing references, back-up macro code … etc).     As described in http://support.microsoft.com/kb/282830, the code may fail with the following errors:   http://support.microsoft.com/kb/282830 Programmatic access to Office VBA project is denied ——————————————————————- From Visual Basic or…

22

Visual Studio 2010 (Windows Forms Application): Working with the Visio 2010 control (Microsoft Office Visio 14.0 Drawing Control – ‘AxInterop.Microsoft.Office.Interop.VisOcx.dll), and how to enable the hidden ‘Shapes’ pane

. . Where did the ‘Shapes’ pane disappear in the 2010 version of the Microsoft Office Visio 14.0 Drawing Control ?      It seems that in the latest version (2010) of the ‘VisOcx.dll’ control, the left hand sideinstruments panel does not show up anymore.        I looked into this and tried to get some feedback from our Visio developers. According…


How to troubleshoot the error message: "The following Microsoft Office solution cannot be installed due to a general installer error: <add-in name>.vsto. 0x80131604" when trying to install a VSTO 2010 Add-in.

      Suppose you develop a simple VSTO Add-in using Visual Studio 2010 and you target the .Net Framework 4.0. When you finish setting up the application’s basic functionalities, you want to test if it runs. Here is a very basic Excel add-in, that should load without any issues: ThisAddIn.cs———————————————————————- using System; using System.Collections.Generic; using…

1

Deploying a Shared COM add-in for Office 2003 (Visual Studio 2008 SP1) [and how to work around a known issue which causes the add-in to fail to load if KB908002 is not installed.]

  Office add-ins can target an application (or many applications if they are Shared COM Add-ins) or only a document. The article http://msdn.microsoft.com/en-us/library/hy7c6z9k.aspx (Office Solutions Development Overview) describes the difference: Choosing an Office Project Type Visual Studio provides the following types of project templates for Office development: Document-level customizations. This type of solution is associated…

1

How to customize the Word 2007 backstage menu using a Shared COM Add-in – Visual Studio 2008 SP1

          The new Microsoft Office Fluent user interface (UI) for Office 2007 and 2010 replaces the old 2003 interface with layered menus, toolbars, and task panes with a simpler system optimized for efficiency and discoverability. The new Fluent UI has improved context menus, Enhanced ScreenTips, a Mini toolbar, and keyboard shortcuts that help to…


Deploying a VSTO Word 2007 add-in to All Users (Visual Studio 2008 SP1)

_____________________________________________ !!!! [PERFORM THIS STEP FIRST] !!!!      To be able to deploy an Add-in to all users (without manually installing for each user account on a machine) you must download and install http://support.microsoft.com/kb/976811 (A 2007 Office system application does not load an add-in that is developed by using VSTO); To enable the hotfix package,…

3