You must create that folder and put the Northwind 2007 database there.
Registering Nwind2Excel.dll in Windows Vista
1. Open a command prompt window by selecting Start ?¤ All Programs ?¤ Accessories ?¤
Command Prompt.
nNote This command prompt must be run using the Run as Administrator right-click menu option.
2. Type regsvr32.exe, followed by a space, and then the full path to Nwind2Excel.dll.
Listing 9-4 (shown previously) shows an example of this command.
3. Press Enter to run the command.
4. Click OK when the success message appears.
Figure 9-1 shows the success message you should see.
Figure 9-1. regsvr32.exe shows a success message upon registering a DLL in Windows Vista.
CHAPTER 9 n ACTIVEX AND .NET 320
Now we can use the DLL in our project.
1. Open a new workbook in Excel.
2. Open the VBE by choosing the Developer ribbon ?¤Visual Basic or by pressing Alt+F11.
3. Add a standard code module in the Project Explorer.
4. Add a reference to the new DLL by selecting Tools ?¤ References.
5. In the References dialog box, scroll down until you see an item named
!Northwind2Excel Object, as shown in Figure 9-2.
Figure 9-2. Adding a reference to !Northwind2Excel Object
nTip When you create custom objects, they tend to get lost in the list in the References dialog box.
Adding the bang (!) character as a prefix helps keep your custom objects near the top of the list and
makes them easier to find.
6. Select it from the list and click OK to close the dialog and store the reference.
Pages:
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299