<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brian Dylan</title>
	<atom:link href="http://www.briandylan.com/wp/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.briandylan.com/wp</link>
	<description>The Writings</description>
	<lastBuildDate>Sat, 05 Jun 2010 23:03:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>My Itinerary</title>
		<link>http://www.briandylan.com/wp/?p=186</link>
		<comments>http://www.briandylan.com/wp/?p=186#comments</comments>
		<pubDate>Sat, 05 Jun 2010 23:03:39 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=186</guid>
		<description><![CDATA[Here is my tentative schedule for my trip home.]]></description>
			<content:encoded><![CDATA[<p>Here is my tentative schedule for my trip home.</p>
<p><iframe src="http://www.google.com/calendar/embed?pvttk=b3ca6274afa480099211b198b5aba021&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=bpkotch%40gmail.com&amp;color=%232952A3&amp;ctz=Pacific%2FAuckland&amp;dates=20100813/20100903" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=186</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My ticket information</title>
		<link>http://www.briandylan.com/wp/?p=176</link>
		<comments>http://www.briandylan.com/wp/?p=176#comments</comments>
		<pubDate>Fri, 04 Jun 2010 23:21:56 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=176</guid>
		<description><![CDATA[The Flight Home Fri, Aug 13, 2010 Depart: 05:15 pm Auckland, New Zealand (AKL) Air New Zealand, Flight 6 Arrive: 10:15 am Los Angeles, CA (LAX) Depart: 01:55 pm Los Angeles, CA (LAX) Air New Zealand, Flight 9140 Arrive: 10:28 pm New York, NY (JFK) The Flight Back to New Zealand Thu, Sep 2, 2010 [...]]]></description>
			<content:encoded><![CDATA[<h3>The Flight Home</h3>
<p><strong>Fri, Aug 13, 2010</strong></p>
<p>Depart: 05:15 pm  Auckland, New Zealand (AKL)  Air New Zealand, Flight 6</p>
<p>Arrive: 10:15 am Los Angeles, CA (LAX)</p>
<p>Depart: 01:55 pm Los Angeles, CA (LAX) Air New Zealand, Flight 9140</p>
<p>Arrive: 10:28 pm  New York, NY (JFK)</p>
<h3>The Flight Back to New Zealand</h3>
<p><strong>Thu, Sep 2, 2010</strong></p>
<p>Depart: 11:30 am New York, NY (JFK) Air New Zealand, Flight 9147</p>
<p>Arrive: 02:38 pm Los Angeles, CA (LAX)</p>
<p>Depart: 11:45 pm Los Angeles, CA (LAX) Air New Zealand, Flight 5</p>
<p>Arrive: 07:55 am Auckland, New Zealand (AKL)</p>
<p><strong>Arrive Sat, Sep 4, 2010</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=176</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Relationships</title>
		<link>http://www.briandylan.com/wp/?p=172</link>
		<comments>http://www.briandylan.com/wp/?p=172#comments</comments>
		<pubDate>Wed, 02 Jun 2010 00:57:06 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=172</guid>
		<description><![CDATA[All relationships end badly. Even the most successful ones end in a funeral.]]></description>
			<content:encoded><![CDATA[<p>All relationships end badly.   Even the most successful ones end in a funeral.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=172</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whiskey Kiss</title>
		<link>http://www.briandylan.com/wp/?p=161</link>
		<comments>http://www.briandylan.com/wp/?p=161#comments</comments>
		<pubDate>Fri, 07 May 2010 05:00:28 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=161</guid>
		<description><![CDATA[Her mouth touched him Like a whiskey&#8217;s kiss. The cool brush of a ringing rim. A moment&#8217;s anticipation. Her warmest touch of amber On his dry cracked lips. Then, she burned. Oh, how she singed and sang. She warmed his cold lesions. She scorched his grand eloquence. She doused his innards in fire. She had [...]]]></description>
			<content:encoded><![CDATA[<p>Her mouth touched him<br />
Like a whiskey&#8217;s kiss.<br />
The cool brush of a ringing rim.<br />
A moment&#8217;s anticipation.<br />
Her warmest touch of amber<br />
On his dry cracked lips.</p>
<p>Then, she burned.<br />
Oh, how she singed and sang.<br />
She warmed his cold lesions.<br />
She scorched his grand eloquence.<br />
She doused his innards in fire.</p>
<p>She had been Roosevelt&#8217;s courage,<br />
When he departed his wife&#8217;s bedside.<br />
She had inspired iconographic hangings,<br />
When the muse&#8217;s rope snapped short.<br />
She had given the suitor succor,<br />
As he pondered where the ring went wrong.</p>
<p>Now, he kissed her.<br />
Then, he drank her.<br />
Always, he needed her<br />
Whiskey kiss.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=161</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We Fuck Stone</title>
		<link>http://www.briandylan.com/wp/?p=160</link>
		<comments>http://www.briandylan.com/wp/?p=160#comments</comments>
		<pubDate>Fri, 30 Apr 2010 00:40:38 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=160</guid>
		<description><![CDATA[We fuck stone. We drive our bones into the dust. I thrust my hard honed hips. You moan and curl your slender bore. As we fuck stone. We seek our needed nutrients. We pull our soft minerals. Mining, Shafting, Drilling, Pounding. Together, we pulverize where we came from. We dig until there&#8217;s nothing left But [...]]]></description>
			<content:encoded><![CDATA[<p>We fuck stone.<br />
We drive our bones into the dust.<br />
I thrust my hard honed hips.<br />
You moan and curl your slender bore.<br />
As we fuck stone.</p>
<p>We seek our needed nutrients.<br />
We pull our soft minerals.<br />
Mining,<br />
Shafting,<br />
Drilling,<br />
Pounding.<br />
Together, we pulverize where we came from.<br />
We dig until there&#8217;s nothing left<br />
But scrag<br />
and slag<br />
and shag.</p>
<p>We fuck stone.<br />
We transmute our metals into rust.<br />
I bury my fingers into your loam.<br />
I mine.<br />
You mine.<br />
We each others mine<br />
As we fuck stone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=160</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smoke</title>
		<link>http://www.briandylan.com/wp/?p=157</link>
		<comments>http://www.briandylan.com/wp/?p=157#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:01:17 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=157</guid>
		<description><![CDATA[I woke up with a cigarette clenched between my lips. The smoke had become omnipresent of late &#8211; Some socially, acceptable cancer, the kind you can joke about &#8211; a little black lung tumor humor.   Later, I rolled up with all the guilt and pleasure of a someone who knew better, who could do [...]]]></description>
			<content:encoded><![CDATA[<p style="margin:0pt">
<p style="margin:0pt"><font face="'times new roman'"><font size="3">I woke up with a cigarette clenched between my lips</font></font><font face="'times new roman'"><font size="3">.</font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">The smoke had become omnipresent of late</font></font><font face="'times new roman'"><font size="3"> &#8211; </font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">Some </font></font><font face="'times new roman'"><font size="3">socially</font></font><font face="'times new roman'"><font size="3">, acceptable cancer,</font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">the kind you can joke about &#8211; <br /></font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3"> a little black lung tumor humor.</font></font></p>
<p style="margin:0pt"> </p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">Later, I r</font></font><font face="'times new roman'"><font size="3">olled up with all the guilt and pleasure</font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">o</font></font><font face="'times new roman'"><font size="3">f a someone who knew better</font></font><font face="'times new roman'"><font size="3">,</font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">w</font></font><font face="'times new roman'"><font size="3">ho could do better</font></font><font face="'times new roman'"><font size="3">,</font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">Like clandestine royalty visiting a brothel</font></font><font face="'times new roman'"><font size="3">.</font></font></p>
<p style="margin:0pt"> </p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">For </font></font><font face="'times new roman'"><font size="3"> the span of a cup of coffee</font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">and a few puffed </font></font><font face="'times new roman'"><font size="3">signals</font></font><font face="'times new roman'"><font size="3">,</font></font></p>
<p style="margin:0pt"><font face="'times new roman'"><font size="3">I was an incognito prince.</font></font></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=157</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Her</title>
		<link>http://www.briandylan.com/wp/?p=114</link>
		<comments>http://www.briandylan.com/wp/?p=114#comments</comments>
		<pubDate>Sun, 14 Mar 2010 18:56:18 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Writing]]></category>
		<category><![CDATA[aging]]></category>
		<category><![CDATA[Birthday]]></category>
		<category><![CDATA[poetry]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=114</guid>
		<description><![CDATA[I watched her brilliance as she flashed amidst heaven - midair for effect. She scorched a Sakura blossom. The pink petal drifted on a hot wind and then slowly curled edges blackening like burnt paper. I smelled a cherry scent tinged with an aroma of vaporised flesh - her perfume. The shadows grew real, as [...]]]></description>
			<content:encoded><![CDATA[<p>I watched her brilliance<br />
as she flashed amidst heaven -<br />
midair for effect.</p>
<p>She scorched a Sakura blossom.<br />
The pink petal drifted on a hot wind<br />
and then slowly curled<br />
edges blackening like burnt paper.<br />
I smelled a cherry scent<br />
tinged with an aroma of vaporised flesh -<br />
her perfume.</p>
<p>The shadows grew real,<br />
as she made them elongate.<br />
Their names etched in stone.</p>
<p>Only I could survive her.<br />
Years of war had lined me<br />
with lead and concrete.<br />
Like some mad Oppenheimer,<br />
changing history for the sake of curiosity,<br />
I had blinded myself with my slated glasses.</p>
<p>I stood transfigured<br />
With heaped ashes of spent lives<br />
Swirling as she came.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=114</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I love you, Mom</title>
		<link>http://www.briandylan.com/wp/?p=112</link>
		<comments>http://www.briandylan.com/wp/?p=112#comments</comments>
		<pubDate>Fri, 19 Feb 2010 23:02:37 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=112</guid>
		<description><![CDATA[I love you, Mom, As you panhandle for golden lollies and scab cigarettes off passersby. You were beautiful, once. You were as pretty as the faded floral dress, hanging, gimballed, off your bony shoulders. Unlike most sons, I see you every day.   I watch you bleach and fade and loosen. I watch your flowers [...]]]></description>
			<content:encoded><![CDATA[<p>I love you, Mom,<br />
As you panhandle for golden lollies<br />
and scab cigarettes off passersby.</p>
<p>You were beautiful, once.<br />
You were as pretty as the faded floral dress,<br />
hanging, gimballed, off your bony shoulders.</p>
<p>Unlike most sons, I see you every day.  <br />
I watch you bleach and fade and loosen.<br />
I watch your flowers go a little more gray.<br />
I pass by your usual bench<br />
as I walk to work.<br />
You still wear the fuzzy, mint green slippers,<br />
From a Christmas,<br />
eight years ago.<br />
You occasionally bark crude solicitations at the young men.</p>
<p>Yet, you never solicit me.<br />
Even, if your milky eyes only perceive<br />
a motion blur of pinstripes and briefcases and silver wrist watches.<br />
You never bum a smoke.<br />
You never ask for change.<br />
You never say, &#8220;Thank you,&#8221;<br />
when I press a fifty into your thin hand.</p>
<p>I love you, Mom.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=112</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exegesis</title>
		<link>http://www.briandylan.com/wp/?p=88</link>
		<comments>http://www.briandylan.com/wp/?p=88#comments</comments>
		<pubDate>Fri, 19 Feb 2010 04:51:51 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=88</guid>
		<description><![CDATA[I lie on the bathroom floor. I wonder, &#8220;What are those marks on the ceiling?&#8221; Shit?  Or blood? Then, I start to think about Christ. And a forensic analysis by the Pharisees. And how the bible mentions how he bled. And how on the crucifix, he always has a loin cloth on. How dead people [...]]]></description>
			<content:encoded><![CDATA[<p>I lie on the bathroom floor.</p>
<p>I wonder, &#8220;What are those marks on the ceiling?&#8221;</p>
<p>Shit?  Or blood?</p>
<p><br class="spacer_" /></p>
<p>Then, I start to think about Christ.</p>
<p>And a forensic analysis by the Pharisees.</p>
<p>And how the bible mentions how he bled.</p>
<p>And how on the crucifix, he always has a loin cloth on.</p>
<p>How dead people tend to shit themselves.</p>
<p>I wonder, &#8220;What&#8217;s that running down his leg?&#8221;</p>
<p><br class="spacer_" /></p>
<p>I turn my gaze to the space behind the toilet.</p>
<p>I discover, &#8220;That&#8217;s where my wedding ring went.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=88</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Pivot Caches</title>
		<link>http://www.briandylan.com/wp/?p=85</link>
		<comments>http://www.briandylan.com/wp/?p=85#comments</comments>
		<pubDate>Wed, 06 Jan 2010 22:20:16 +0000</pubDate>
		<dc:creator>briandylan</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.briandylan.com/wp/?p=85</guid>
		<description><![CDATA[In Excel 2007, if you are trying to manipulate the Pivot Caches in multiple pivot tables, be careful.   The seemingly innocuous pivotcache.index property is a potential trap.  Note, that you can only change the pivotcache on EXTERNAL data by setting the CacheIndex.   ChangePivotCache is for internal use only (and doesn’t exist in 2003). [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In Excel 2007, if you are trying to manipulate the Pivot Caches in multiple pivot tables, be careful.   The seemingly innocuous pivotcache.index property is a potential trap.  Note, that you can only change the pivotcache on EXTERNAL data by setting the CacheIndex.   ChangePivotCache is for internal use only (and doesn’t exist in 2003).</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Take this code:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Dim masterIndex as Integer</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">masterIndex = masterPivotTable.PivotCache.Index</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">destinationPivotTable.PivotCache.Index = masterIndex</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">This sets the pivot cache of one pivot table to another.  It saves on memory and makes the pivot tables share the same data source.   Really handy for automating reporting.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">However, there’s a trap here.   In Excel 2007, changing the pivot cache automatically removes the old pivot cache.   It works in 2003, and I suspect it keeps the old worksheets floating around.  This can create invalid indexes if you are not careful.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">If you use the first worksheet as the master, that’s fine.  Its index will always be 1.  If you use a subsequent worksheet as a master, its index will change as you update subsequent reports with a lower index.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Pivot Cache Indexes Before Update:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>2</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>[3]  Master Index</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>4</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">When you update 1, the indexes look like this:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Pivot Cache Indexes After Update:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>[2] Master Index</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>3</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Why?   Because the old index 1 got removed and the pivot caches got reindexed.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Fortunately, all of this is easily avoided.   Instead of tracking the index, track a pointer to the pivot table instead.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Dim MasterPivotTable as PivotTable</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">‘Insert your pivot table here</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Set MasterPivotTable = Sheet1.PivotTable(1)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">destinationPivotTable.PivotCache.Index = MasterPivotTable.PivotCache.Index</div>
<p>In Excel 2007, if you are trying to manipulate the Pivot Caches in multiple pivot tables, be careful.   The seemingly innocuous pivotcache.index property is a potential trap.  Note, that you can only change the pivotcache on EXTERNAL data by setting the CacheIndex.   ChangePivotCache is for internal use only (and doesn’t exist in 2003).</p>
<p>Take this code:</p>
<p><span style="color: #0000ff;">Dim</span> masterIndex <span style="color: #0000ff;">As Integer</span></p>
<p>masterIndex = masterPivotTable.PivotCache.Index</p>
<p>destinationPivotTable.PivotCache.Index = masterIndex</p>
<p>This sets the pivot cache of one pivot table to another.  It saves on memory and makes the pivot tables share the same data source.   Really handy for automating reporting.</p>
<p>However, there’s a trap here.   In Excel 2007, changing the pivot cache automatically removes the old pivot cache.   It works in 2003, and I suspect it keeps the old worksheets floating around.  This can create invalid indexes if you are not careful.</p>
<p>If you use the first worksheet as the master, that’s fine.  Its index will always be 1.  If you use a subsequent worksheet as a master, its index will change as you update subsequent reports with a lower index.</p>
<p>Pivot Cache Indexes Before Update:</p>
<ul>
<li> <span style="white-space: pre;"> </span>1</li>
<li><span style="white-space: pre;"> </span>2</li>
<li><span style="white-space: pre;"> </span><strong>[3]</strong> Master Index</li>
<li><span style="white-space: pre;"> </span>4</li>
</ul>
<p>When you update 1, the indexes look like this:</p>
<p>Pivot Cache Indexes After Update:</p>
<ul>
<li><span style="white-space: pre;"> </span>1</li>
<li><span style="white-space: pre;"> </span><strong>[2]</strong> Master Index</li>
<li><span style="white-space: pre;"> </span>3</li>
</ul>
<p><span style="white-space: pre;"> </span>Why?   Because the old index 1 got removed and the pivot caches got reindexed.</p>
<p>Fortunately, all of this is easily avoided.   Instead of tracking the index, track a pointer to the pivot table instead.</p>
<p><span style="color: #0000ff;">Dim</span> MasterPivotTable <span style="color: #0000ff;">as</span> PivotTable</p>
<p><span style="color: #008000;">‘Insert your pivot table here</span></p>
<p><span style="color: #0000ff;">Set </span>MasterPivotTable = Sheet1.PivotTable(1)</p>
<p>destinationPivotTable.PivotCache.Index = MasterPivotTable.PivotCache.Index</p>
<p>That&#8217;s how you swap a pivot cache properly, without the two days of a random 1004 error.</p>
<p>Fuck, I hate excel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandylan.com/wp/?feed=rss2&amp;p=85</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
