SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 292 | Next

Jim DeMarco

"Pro Excel 2007 VBA"

NET 327
3. In the Name text box, name the project NWindDataAddIn.
4. Leave the ???Create directory for solution??? check box checked.
5. Click OK.
The new project is created, as shown in Figure 9-10.
Figure 9-10. New Excel 2007 add-in project
We??™ll look at the default contents of the add-in project in a moment, but first let??™s create
our data access component. We will add another project to our add-in project. Once the coding
is finished, we??™ll have to add a reference to our data access project before we can use it.
The Data Access Component
We could add a new class directly in our add-in project, but it makes sense to put that in its
own project where it will become a separate component. This gives you the option to easily
use your data access layer in other projects.
CHAPTER 9 n ACTIVEX AND .NET 328
1. Select the NWindDataAddIn project in the Solution Explorer.
2. Select File ?¤ Add ?¤ New Project (Figure 9-11).
Figure 9-11. Adding a new project to the solution
3. In the Add New Project dialog box, select Windows from the ???Project types??? list.
4. Select Class Library from the Templates section.
CHAPTER 9 n ACTIVEX AND .NET 329
5. Name the new project NWindDataAccess, as shown in Figure 9-12.
Figure 9-12. Creating a new class library project
6. Click OK.
A new project is added to the Solution Explorer and an empty class module is created, as
shown in Figure 9-13.
CHAPTER 9 n ACTIVEX AND .NET 330
Figure 9-13. New class library project added
The default name for the new class is Class1.


Pages:
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304