accdb), cell locations for the data, what data is autofiltered, and
whether a totals row is shown.
CHAPTER 3 n USING XML IN EXCEL 2007 127
Figure 3-30. Table1.xml contents
There is also table style information in the last node of the file. So how are the queryTable
and Table1.xml files associated? In the tables folder is a subfolder named _rels. This folder
contains a file named table1.xml.rels (the full path to the file is \xl\table\_res.\
table1.xml.rels). The contents of table1.xml.rels is shown in Figure 3-31.
Figure 3-31. table1.xml.rels contents
As you can see, the tables folder??™s Relationship element is referring to the
relationships/queryTable content item in its Type attribute with a target of the
queryTable1.xml file.
Adding a Ribbon to Run Your Custom Macros
So that was quite a bit to take in just to add a ribbon to a project, right? It??™s really just important
background information that will be helpful as you do more and more work with Excel
(or other Office products).
Next, let??™s add a ribbon to our XML data project. We??™re going to add a ribbon that contains
one tab with four groups: one for adding new data, one for appending data, one for
refreshing data, and one for saving data.
To do so, we will create a ribbon extensibility customization file with one tab, four groups,
and seven buttons. We??™ll specify a callback event in the buttons to call each macro we??™ve created
in the document. Then we will modify the contents of the macro-enabled document
container file to point to the ribbon extensibility customization file.
Pages:
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151