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 112 | Next

Jim DeMarco

"Pro Excel 2007 VBA"

The
ActiveWorkbook object has all the properties and methods of the Workbook object.
Figure 3-1. ActiveWorkbook property of Application object
If you try double-clicking the ActiveWorkbook property, you will not find any properties or
methods associated with it in the Object Browser. Click the Workbook link in the description
section of the Object Browser, however, and you will see the Workbook object??™s properties and
methods listed, as shown in Figure 3-2. Since a reference to the ActiveWorkbook is actually
returning a Workbook, you can access all of these properties and methods.
Figure 3-2.Workbook object and class members
I??™ll present you with a quick example to show that the two objects contain the same class
members. Following are two screenshots. Figure 3-3 contains the Immediate window showing
IntelliSense for the Workbook object, and Figure 3-4 shows IntelliSense for the ActiveWorkbook
object.
CHAPTER 3 n USING XML IN EXCEL 2007 100
Figure 3-3. IntelliSense for Workbook object
Figure 3-4. IntelliSense for ActiveWorkbook object
So if you find yourself examining an object in the Object Browser and you don??™t see any
class members, check to see if it??™s a property of another object and look at that object??™s class
members.
Before we run the code, let??™s take a look at the XmlImport function and see what it does
(see Figure 3-5).
Figure 3-5. XmlImport function arguments
The XmlImport function takes four arguments, as shown in Table 3-1.
CHAPTER 3 n USING XML IN EXCEL 2007 101
Table 3-1.


Pages:
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124