Skip to Main Content
Excel 2003 Programming: A Developer's Notebook
book

Excel 2003 Programming: A Developer's Notebook

by Jeff Webb
August 2004
Intermediate to advanced content levelIntermediate to advanced
312 pages
8h 30m
English
O'Reilly Media, Inc.
Content preview from Excel 2003 Programming: A Developer's Notebook

Debug .NET Components

If you’ve been following along with the preceding example by writing code in Excel and Visual Studio .NET, you’ve probably noticed that you can’t build the .NET project while Excel has a reference to that project’s type library. You need to close Excel or remove the reference each time you make a change in the .NET project. That’s because Visual Studio .NET can’t overwrite the type library while another application is using it.

This makes debugging .NET components from Excel difficult. In fact, it’s not a very good practice. It is a much better practice to add a second test project to your .NET component solution and make that project the start-up project.

Note

Building tests into your development projects is a good practice. In fact, there’s a schoolof thought (called extreme programming) that says you should write tests first, before you implement any feature.

How to do it

To add a test project to the NetForExcel sample, follow these steps:

  1. From Visual Studio .NET, choose File Add Project New Project. Visual Studio .NET displays the Add New Project dialog box.

  2. Select the Console Application template from the VBA project types, give the project a descriptive name, and click OK. Visual Studio .NET creates a folder and template files for the new Windows console application.

  3. Right-click on the new project title in the Solution Explorer and select Set As Startup Project from the pop-up menu, as shown in Figure 5-6. Visual Studio .NET makes the project ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Office Excel 2003 Programming Inside Out

Microsoft® Office Excel 2003 Programming Inside Out

Curtis Frye, Wayne S. Freeze, Felicia K. Buckingham
Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
Office 2003 XML

Office 2003 XML

Simon St. Laurent, Mary McRae, Evan Lenz

Publisher Resources

ISBN: 0596007671Supplemental ContentCatalog PageErrata