Home > Microsoft .Net Development Tips > Microsoft Office Development > Migrating add-ins from VBA to VSTO
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

MICROSOFT OFFICE DEVELOPMENT

Migrating add-ins from VBA to VSTO


Brian Eastwood, Site Editor
11.24.2006
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Years after the release of the .NET Framework, many developers are sticking with VB 6 applications developed in VBA. Many of these apps tend to work with only an occasional hiccup, while some are so involved that a quick and easy migration to .NET is nearly impossible.

The combined power of Visual Studio 2005 Tools for Office (VSTO) and Office 2007 may be enough to convince many developers to move to .NET.

With VSTO, Word and Excel are incorporated directly into the Visual Studio IDE, developers have access to .NET's vast class libraries, and there is support for IntelliSense and debugging. In Vista, meanwhile, menus, toolbars and task panes have been replaced with a customizable UI element called the ribbon, which displays the most frequently used commands.

A large concern here is getting those old VBA solutions into VSTO. How difficult will it be? What will happen to the solution once it becomes a VSTO add-in? What will and will not work?

Jan Fransen of MCW Technologies addresses these issues in the recent MSDN article, Migrating a VBA Solution to a Visual Studio Tools for Office Add-In.

The author begins by noting that not all VBA solutions should be migrated to VSTO. "If a solution has been runnin


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Microsoft Office Development
Downloadable MSDN library released for VS 2008 SP 1
Check the MSDN Virtual Labs for regular, compelling new content
Windows XP SP3 pack includes new XML parser, enhanced IP security
Book excerpt: Building personalized solutions in SharePoint 2007
Book excerpt: Building document management solutions in SharePoint 2007
XAML as an everywhere presentation format
Where are the Visual Studio 2008 Tools for Office?
ClickOnce: Automated smart client deployment
Book excerpt: SharePoint 2007 and content types
Update desktops automatically using the AppUpdater component

Visual Studio Tools for Office (VSTO)
Where are the Visual Studio 2008 Tools for Office?
Using SharePoint, Office to develop portals and mashups
Gates offers musings on Office, services at ODC
Office System Developer Conference 2008 preview
What Visual Studio 2008 brings to client application development
On migrating from VBA to VSTO
Component works with Word files inside .NET applications
VSTA: How lightweight can you get?
Ten cool Visual Studio Orcas features, part 1
Office plug-ins possible with Visual Studio add-in

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


g well for years and you do not plan to add anything new to it, it is probably best to leave it where it is," Fransen writes. On the other hand, "If you design something new, or plan major enhancements to an existing solution, or if you would like to change a document-level solution into an application-level solution, you should look carefully at what [VSTO] offers."

From there, Fransen describes his sample VBA solution and then goes through the steps necessary to migrate it to VSTO Second Edition (the version that works with Windows Vista). Topics covered along the way include Windows Forms controls, working with Web services and displaying a custom task pane.

Fransen provides both VB and C# sample code throughout the article. He also notes that familiar VBA constructs and functions will still work in VSTO.

"[I]f you are new to the .NET Framework, you might find it easier to use the VBA-style functions (such as MsgBox) and constructs (such as With…End With) that are still available to Visual Basic programmers," Fransen writes. "If you write in Visual Basic but are interested in using the .NET Framework whenever possible, take a look at the equivalent C# code for each example."

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts