CHAPTER 9 n ACTIVEX AND .NET 339
Excel 2007 will appear with the Northwind Employees table loaded into Sheet1, as shown
in Figure 9-18.
Figure 9-18. Northwind data added to the worksheet from the add-in project
I mentioned earlier that this is accomplished with no code at all in the workbook. Let??™s
take a look at the VBE in the Excel workbook we just opened through our code.
Open the Excel VBE by selecting the Developer ribbon ?¤ Code tab ?¤Visual Basic command,
or by pressing Alt+F11. Look through all of the built-in code modules and you will not
find one bit of code.
nNote All Excel workbooks ship with built-in code modules representing the code behind the workbook
(ThisWorkbook) and its worksheets (Sheet1, Sheet2, etc.). You can find this code in the VBA IDE Project
Explorer by double-clicking the item in the Project Explorer??™s Microsoft Excel Objects folder.
How does the workbook know where to find the data, then?
1. Return to Excel and click the Office button, and then select Excel Options.
2. Select Add-Ins from the left-hand navigation to display the Add-ins list, as shown in
Figure 9-19.
CHAPTER 9 n ACTIVEX AND .NET 340
Figure 9-19. The Add-ins list in the Excel Options dialog box
This section gives you a snapshot of available and active add-in applications. Excel will
leave these add-ins loaded even after you close Visual Studio. Before you close the workbook,
and while the Excel Options dialog is still open, unload the add-in as follows.
Pages:
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312