<?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"
	>

<channel>
	<title>XLNS</title>
	<atom:link href="http://xlns.lamkamp.nl/Index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://xlns.lamkamp.nl</link>
	<description>Just another Spreadsheet weblog</description>
	<pubDate>Fri, 28 May 2010 06:28:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Slicers and Filters in Excel 2010 Pivottables</title>
		<link>http://xlns.lamkamp.nl/?p=33</link>
		<comments>http://xlns.lamkamp.nl/?p=33#comments</comments>
		<pubDate>Fri, 28 May 2010 06:28:16 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=33</guid>
		<description><![CDATA[I’m not sure if what I experienced is a bug or a feature….
I created a pivottable in Excel 2010 with slicers and made a selection via the slicers.
So  far so good but when I wanted to see the records for a specific datapoint and double click on this point it will give me the [...]]]></description>
			<content:encoded><![CDATA[<p>I’m not sure if what I experienced is a bug or a feature….<br />
I created a pivottable in Excel 2010 with slicers and made a selection via the slicers.<br />
So  far so good but when I wanted to see the records for a specific datapoint and double click on this point it will give me the complete recordset not taking into account the slicer settings.<br />
But when I put in pivottablefilters for the same fields as the slicers it all works like good old pivottables doubleclicking.</p>
<p>Does anybody know if this is a feature or a bug….?</p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=33</wfw:commentRss>
		</item>
		<item>
		<title>Risk Management is a game without end</title>
		<link>http://xlns.lamkamp.nl/?p=32</link>
		<comments>http://xlns.lamkamp.nl/?p=32#comments</comments>
		<pubDate>Tue, 16 Mar 2010 09:35:56 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=32</guid>
		<description><![CDATA[Three actuaries and three accountants are traveling by train to visit a &#8216;Risk Management Conference&#8217;. At the station, the three accountants each buy tickets and watch as the three actuaries buy only a single ticket.
&#8220;This looks very risky. How are three people going to travel on only one ticket?&#8221;, one of the accountants asks.
&#8220;Watch and [...]]]></description>
			<content:encoded><![CDATA[<p>Three actuaries and three accountants are traveling by train to visit a &#8216;Risk Management Conference&#8217;. At the station, the three accountants each buy tickets and watch as the three actuaries buy only a single ticket.</p>
<p>&#8220;This looks very risky. How are three people going to travel on only one ticket?&#8221;, one of the accountants asks.</p>
<p>&#8220;Watch and you&#8217;ll see! Take notice of our brand new risk management approach&#8221;, one of the actuaries answers.</p>
<p>They all board the train. The accountants take their respective first class seats, but all three actuaries cram into a restroom and close the door behind them.</p>
<p>Shortly after the train has departed, the conductor comes around collecting tickets. He knocks on the restroom door and says, &#8220;Ticket, please.&#8221; The door opens just a crack and a single arm emerges with a ticket in hand. The conductor takes it and moves on.</p>
<p>The accountants were deeply impressed by the actuarial approach and agreed it was - after all - quite a clever idea without any substantial risk.</p>
<p>So, completely confident and with even more Risk Management skills gained at the inspiring Conference, the accountants decide to copy the actuaries new risk approach on the return trip and save some money (accountants have always been clever with money!). When they get to the station they buy a single ticket for the return trip.</p>
<p>To their astonishment, this time the actuaries don&#8217;t buy a ticket at all. &#8220;This is reckless, how are you going to travel without a single ticket?&#8221;, one of the perplexed accountants asked. &#8220;Watch and you&#8217;ll see! Take full notice of our latest risk management approach&#8221; answered an actuary.</p>
<p>When they board the train the three accountants cram into a restroom and the three actuaries cram into another one nearby. The train departs.</p>
<p>Shortly afterward, one of the actuaries leaves his restroom and walks over to the restroom where the accountants are hiding. He knocks on the door and says, &#8220;Ticket, please.&#8221;</p>
<p>Conclusion:<br />
What conclusions can we draw from this simple story?</p>
<p>Risk Management is a game without end</p>
<p>The effect of Risk Management Conferences is threefold:</p>
<p>Some attendants get smarter<br />
Others get overconfident<br />
Final result: Increasing Risk, instead of decreasing Risk</p>
<p>There&#8217;s an old Dutch saying that expresses the danger of increased Risk Management :</p>
<p>&#8220;A warned man counts for two&#8221;</p>
<p>If we want to reap the fruits of Risk Management, accountants and actuaries have to start working together, instead of struggling and competing each other.</p>
<p>Risk Manager Profile and qualifications<br />
Insight, creativity and integrity are important requirements to become a professional Risk Manager. Unfortunately, this is not enough.</p>
<p>To tackle Risk Management in a company, you need the best potential crook around. One who&#8217;s willing to settle his salary and earnings for a little less than he would have earned as a real crook, in return for having a respectable job and not risking to end up in jail. You could call it the Personal Risk management of the Risk manager. Employers that settle for an inferior Risk Manager, know one thing for sure: someday somebody more &#8216;crooky&#8217; than &#8216;your risk manager&#8217; will tear your company down!</p>
<p><a href="http://www.blogcatalog.com/blog/actuary-info/8a181db4bf32bcc55fa11fe97ab5cac7">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=32</wfw:commentRss>
		</item>
		<item>
		<title>VBA function for returning Column names, type as a dictionary</title>
		<link>http://xlns.lamkamp.nl/?p=30</link>
		<comments>http://xlns.lamkamp.nl/?p=30#comments</comments>
		<pubDate>Tue, 16 Feb 2010 12:17:59 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=30</guid>
		<description><![CDATA[I needed the column names of a sql server 2008 table.
So I wrote a function who would return a dictionary with the column names as the key and the type as the item.
&#8216;Set Reference to Microsoft Scripting Runtime
&#8216;Set Reference to Microsoft ActiveX Data Objects 2.7 Library
Function ColumnNames(ByVal sConnection As String, ByVal sTable As String) As [...]]]></description>
			<content:encoded><![CDATA[<p>I needed the column names of a sql server 2008 table.<br />
So I wrote a function who would return a dictionary with the column names as the key and the type as the item.</p>
<p>&#8216;Set Reference to Microsoft Scripting Runtime<br />
&#8216;Set Reference to Microsoft ActiveX Data Objects 2.7 Library</p>
<p>Function ColumnNames(ByVal sConnection As String, ByVal sTable As String) As Dictionary</p>
<p>   Dim cConnection As ADODB.Connection<br />
   Dim rsRecordset As ADODB.Recordset<br />
   Dim sSQL As String<br />
   Dim dColumnNames As Dictionary</p>
<p>   sSQL = sSQL &amp; &#8220;SELECT sc.name AS column_name, st.name AS datatype &#8221;<br />
   sSQL = sSQL &amp; &#8220;FROM sysobjects so &#8221;<br />
   sSQL = sSQL &amp; &#8220;JOIN syscolumns sc ON so.id = sc.id &#8221;<br />
   sSQL = sSQL &amp; &#8220;JOIN systypes st ON sc.xtype = st.xtype &#8221;<br />
   sSQL = sSQL &amp; &#8220;WHERE so.xtype = &#8216;U&#8217; AND st.name &lt;&gt; &#8217;sysname&#8217; AND so.name = &#8216;&#8221; &amp; sTable &amp; &#8220;&#8216;&#8221;</p>
<p>   Set dColumnNames = New Dictionary</p>
<p>   Set cConnection = New ADODB.Connection</p>
<p>   cConnection.Open sConnection<br />
   Set rsRecordset = New ADODB.Recordset<br />
   Set rsRecordset.ActiveConnection = cConnection</p>
<p>   rsRecordset.Open sSQL</p>
<p>   Do While Not rsRecordset.EOF And Not rsRecordset.BOF</p>
<p>      dColumnNames.Add rsRecordset.Fields(0).Value, rsRecordset.Fields(1).Value<br />
      rsRecordset.MoveNext</p>
<p>   Loop</p>
<p>   Set rsRecordset = Nothing<br />
   cConnection.Close<br />
   Set cConnection = Nothing</p>
<p>   Set ColumnNames = dColumnNames</p>
<p>End Function</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=30</wfw:commentRss>
		</item>
		<item>
		<title>VLOOKUP returning multiple columns</title>
		<link>http://xlns.lamkamp.nl/?p=29</link>
		<comments>http://xlns.lamkamp.nl/?p=29#comments</comments>
		<pubDate>Mon, 08 Feb 2010 06:58:20 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=29</guid>
		<description><![CDATA[I use this method for a long time now a just reccently discovered nobody else does.
I&#8217;ve got 2 tables, lets call them tbMaster ans tbSlave.  Most people use a new vlookup for every column they want to retrieve from tbSlave. What I usually do is use vlookup as an array formula.
For example if I want [...]]]></description>
			<content:encoded><![CDATA[<p>I use this method for a long time now a just reccently discovered nobody else does.</p>
<p>I&#8217;ve got 2 tables, lets call them tbMaster ans tbSlave.  Most people use a new vlookup for every column they want to retrieve from tbSlave. What I usually do is use vlookup as an array formula.</p>
<p>For example if I want to get the 4th, 7th and 9th column from tbSlave I select 3 columns in tbMaster and type     =VLOOKUP(tbMaster[[#This Row],[Name]],tbSlave,{4,7,9},0) followed by Ctrl Shift Enter</p>
<p>Besides the normal vlookup disadvantages in my opinion the array solution is better</p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=29</wfw:commentRss>
		</item>
		<item>
		<title>The risks of stupidity</title>
		<link>http://xlns.lamkamp.nl/?p=28</link>
		<comments>http://xlns.lamkamp.nl/?p=28#comments</comments>
		<pubDate>Thu, 08 Oct 2009 12:55:45 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=28</guid>
		<description><![CDATA[A general once made a practical observation on the risks of stupidity.
 
I divide my officers into four classes; the clever, the lazy, the industrious, and the stupid. 
Each officer possesses at least two of these qualities. 
Those who are clever and industrious are fitted for the highest staff appointments. 
Use can be made of [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-size: small;"><span style="font-family: Calibri;">A general once made a practical observation on the risks of stupidity.</span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-family: Calibri; font-size: small;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-size: small;"><span style="font-family: Calibri;">I divide my officers into four classes; the clever, the lazy, the industrious, and the stupid. </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-size: small;"><span style="font-family: Calibri;">Each officer possesses at least two of these qualities. </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-size: small;"><span style="font-family: Calibri;">Those who are clever and industrious are fitted for the highest staff appointments. </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-size: small;"><span style="font-family: Calibri;">Use can be made of those who are stupid and lazy. </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-size: small;"><span style="font-family: Calibri;">The man who is clever and lazy however is for the very highest command; he has the temperament and nerves to deal with all situations. </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="mso-ansi-language: EN;" lang="EN"><span style="font-family: Calibri; font-size: small;">But whoever is stupid and industrious is a menace and must be removed immediately!</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=28</wfw:commentRss>
		</item>
		<item>
		<title>Technical Preview program MS Office 2010</title>
		<link>http://xlns.lamkamp.nl/?p=26</link>
		<comments>http://xlns.lamkamp.nl/?p=26#comments</comments>
		<pubDate>Wed, 15 Jul 2009 05:55:12 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=26</guid>
		<description><![CDATA[Just got my invitation mail for the Technical Preview program for Office 2010.
I&#8217;m gonna dedicate a machine to Windows 7 and Office 2010 because you can&#8217;t upgrade
a 64bit Office 2007 system to a Office 2010 system.
Any post will have to wait until I get back from my 2 weeks of vacation starting next friday.
]]></description>
			<content:encoded><![CDATA[<p>Just got my invitation mail for the Technical Preview program for Office 2010.<br />
I&#8217;m gonna dedicate a machine to Windows 7 and Office 2010 because you can&#8217;t upgrade<br />
a 64bit Office 2007 system to a Office 2010 system.</p>
<p>Any post will have to wait until I get back from my 2 weeks of vacation starting next friday.</p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=26</wfw:commentRss>
		</item>
		<item>
		<title>Compagny Culture</title>
		<link>http://xlns.lamkamp.nl/?p=23</link>
		<comments>http://xlns.lamkamp.nl/?p=23#comments</comments>
		<pubDate>Thu, 14 May 2009 08:48:08 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=23</guid>
		<description><![CDATA[Start with a cage containing five apes.  In the cage, hang a banana on a string and put stairs
under it.  Before long, an ape will go to the stairs and start to climb towards the banana.
As soon as he touches the stairs, spray all of the apes with cold water.  After a [...]]]></description>
			<content:encoded><![CDATA[<p>Start with a cage containing five apes.  In the cage, hang a banana on a string and put stairs<br />
under it.  Before long, an ape will go to the stairs and start to climb towards the banana.<br />
As soon as he touches the stairs, spray all of the apes with cold water.  After a while, another<br />
ape makes an attempt with the same result-all the apes are sprayed with cold water.</p>
<p>When another ape tries to climb the stairs, the other apes will try to prevent it.</p>
<p>Now, turn off the cold water.  Next, remove one ape from the cage and replace it with a new one.<br />
The new ape sees the banana and wants to climb the stairs. To his horror, all of the other apes<br />
attack him.</p>
<p>After another attempt and attack, he knows that if he tries to climb the stairs, he will be<br />
assaulted.  Next, remove another of the original five apes and replace it with a new one.<br />
The newcomer goes to the stairs and is attacked. The previous newcomer takes<br />
part in the punishment with enthusiasm.</p>
<p>Again, replace a third original ape with a new one. The new one makes it to the stairs and is<br />
attacked as well.  Two of the four apes that beat him have no idea why they were not permitted<br />
to climb the stairs, or why they are participating in the beating of the newest ape.</p>
<p>After replacing the fourth and fifth original apes, all the apes which have<br />
been sprayed with cold water have been replaced.   Nevertheless, no ape<br />
ever again approaches the stairs.<br />
Why not? &#8220;Because that&#8217;s the way it&#8217;s always been around here.&#8221;</p>
<p>That&#8217;s how individual initiative is beaten to death and a company culture begins.</p>
<p>( If you pay peanuts,&#8230; you get monkeys )</p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=23</wfw:commentRss>
		</item>
		<item>
		<title>The Microsoft Office 2010 IT Blog</title>
		<link>http://xlns.lamkamp.nl/?p=22</link>
		<comments>http://xlns.lamkamp.nl/?p=22#comments</comments>
		<pubDate>Wed, 13 May 2009 06:31:14 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=22</guid>
		<description><![CDATA[Just found a new Microsoft Blog about Office 2010.
There is almost nothing there yet but I should be great&#8230;
http://blogs.technet.com/office2010/
Enjoy
]]></description>
			<content:encoded><![CDATA[<p>Just found a new Microsoft Blog about Office 2010.<br />
There is almost nothing there yet but I should be great&#8230;</p>
<p><a href="http://blogs.technet.com/office2010/">http://blogs.technet.com/office2010/</a></p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=22</wfw:commentRss>
		</item>
		<item>
		<title>Back from the Excel User Conference 2009 in London</title>
		<link>http://xlns.lamkamp.nl/?p=21</link>
		<comments>http://xlns.lamkamp.nl/?p=21#comments</comments>
		<pubDate>Tue, 07 Apr 2009 08:42:51 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=21</guid>
		<description><![CDATA[Just got back from the Excel User Conference 2009 in London.
Ment to drop in to the G20 but couldn&#8217;t find the time to do so.
I had a great time talking, eating and drinking beer with the great ones&#8230;.
Maybe next time there should be a developer or advanced edition.
Looking forward to blogging on all my new [...]]]></description>
			<content:encoded><![CDATA[<p>Just got back from the Excel User Conference 2009 in London.<br />
Ment to drop in to the G20 but couldn&#8217;t find the time to do so.<br />
I had a great time talking, eating and drinking beer with the great ones&#8230;.<br />
Maybe next time there should be a developer or advanced edition.<br />
Looking forward to blogging on all my new ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=21</wfw:commentRss>
		</item>
		<item>
		<title>Update Pivottable through swapping the pivotcache</title>
		<link>http://xlns.lamkamp.nl/?p=20</link>
		<comments>http://xlns.lamkamp.nl/?p=20#comments</comments>
		<pubDate>Wed, 25 Mar 2009 20:07:10 +0000</pubDate>
		<dc:creator>Jelle-Jeroen</dc:creator>
		
		<category><![CDATA[Pivot Tables]]></category>

		<guid isPermaLink="false">http://xlns.lamkamp.nl/?p=20</guid>
		<description><![CDATA[First of all, let me start by appologizing for not blogging for xxx weeks.
Having done that I want to blog about the use of pivottables for reporting to management.
Recently I started working at a new company and discovered a giant heap of workbooks.
A lot of them are used for reporting to managent. For example there [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, let me start by appologizing for not blogging for xxx weeks.<br />
Having done that I want to blog about the use of pivottables for reporting to management.<br />
Recently I started working at a new company and discovered a giant heap of workbooks.<br />
A lot of them are used for reporting to managent. For example there is one workbook which<br />
contains 10 pivottables based on basically two recordsets. The size of this monster is<br />
almost 100 MB because each pivottable has its own pivotcache.<br />
The same workbook is refreshed every day and saved with new data on the network with<br />
a new name. This means 2G of storage space every month. The refreshing is done by<br />
changing a cell with the dateparameter in it and updating the pivotcaches through a macro<br />
called by a button on the sheet.</p>
<p>What I dislike about this aproach is the button on the sheet, the size of the workbook(s)<br />
and the dependancy on odbc links. So I started thinking on a new setup for this workbook.<br />
The first abvious thing was changing to 2 main pivotcaches this would reduce the size to less<br />
than 8 MB whitch means a 90% reduction of disk space.<br />
Secondly I wanted to refresh the data by connecting a new pivotcache to the pivottables.<br />
In the past I wrote some code to switch pivotcaches between pivottables and to produce a<br />
pivotcache from a sql statement and a connectionstring. It looked liked I was almost there<br />
but there were a couple of pitfalls. Apperently you must create a pivottable first from a<br />
pivotcache to be able to switch the pivotcache. Also when the your pivottable uses calculated<br />
fields in the value section switching the cache results in a blank pivottable.<br />
After realizing these things the coding didn’t take along time. Altough everything works I would<br />
like a answer from microsoft or anybody else about the problem around using a pivotcache<br />
without pivottable and the calculated field issue. Below the code without error handling for<br />
the obvious reasons. Comments a very welcome.</p>
<p><code>Sub UpdateWorkbook()</code></p>
<p>Dim sSQL1 As String: Dim sSQL2 As String: Dim sDate As String</p>
<p>sDate = InputBox(&#8221;Enter the date (yyyymmdd)&#8221;)</p>
<p>sSQL1 = &#8220;SELECT *, (new-old) AS change FROM table1 WHERE date=&#8217;&#8221; &amp; sDate &amp; &#8220;&#8216;&#8221;<br />
sSQL2 = &#8220;SELECT * FROM table1 WHERE date = &#8216;&#8221; &amp; sDate &amp; &#8220;&#8216;&#8221;</p>
<p>SwapPivotCaches sSQLServer, sSQL1, &#8220;PivotTable1&#8243;<br />
SwapPivotCaches sSQLServer, sSQL2, &#8220;PivotTable2&#8243;</p>
<p>End Sub</p>
<p>Sub SwapPivotCaches(sConnection As String, sSQL As String, sPivotTable As String)</p>
<p>Dim pcTemp As PivotCache: Dim ptTemp As PivotTable<br />
Dim ws As Worksheet: Dim pt As PivotTable</p>
<p>Application.ScreenUpdating = False<br />
Sheet0.Visible = xlSheetVisible</p>
<p>Set pcTemp = PivotCacheFromSQL(sSQL, sConnection)</p>
<p>Set ptTemp = pcTemp.CreatePivotTable(TableDestination:=Sheet0.Range(&#8221;B5&#8243;))</p>
<p>For Each ws In ActiveWorkbook.Worksheets<br />
For Each pt In ws.PivotTables<br />
If pt.Name = sPivotTable Then pt.CacheIndex = ptTemp.CacheIndex<br />
Next pt<br />
Next ws</p>
<p>Set ptTemp = Nothing<br />
Set pcTemp = Nothing</p>
<p>Sheet0.Cells.Delete<br />
Sheet0.Visible = xlSheetVeryHidden<br />
Application.ScreenUpdating = False</p>
<p>End Sub</p>
<p>Function PivotCacheFromSQL(sSQL As String, sConnection As String) As PivotCache</p>
<p>Dim cConnection As ADODB.Connection<br />
Dim rsRecordset As ADODB.Recordset<br />
Dim cmdCommand As ADODB.Command<br />
Dim pcPivotCache As PivotCache</p>
<p>Dim iErrorCounter As Integer</p>
<p>iErrorCounter = 0</p>
<p>Set cConnection = New ADODB.Connection</p>
<p>cConnection.Open sConnection</p>
<p>Set cmdCommand = New ADODB.Command<br />
Set cmdCommand.ActiveConnection = cConnection</p>
<p>With cmdCommand<br />
.CommandText = sSQL<br />
.CommandType = adCmdText<br />
End With</p>
<p>Set rsRecordset = New ADODB.Recordset<br />
Set rsRecordset.ActiveConnection = cConnection</p>
<p>rsRecordset.Open cmdCommand</p>
<p>Set pcPivotCache = ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)<br />
Set pcPivotCache.Recordset = rsRecordset</p>
<p>Application.StatusBar = False</p>
<p>Set PivotCacheFromSQL = pcPivotCache</p>
<p>Set rsRecordset = Nothing<br />
Set cmdCommand = Nothing<br />
Set cConnection = Nothing</p>
<p>End Function</p>
]]></content:encoded>
			<wfw:commentRss>http://xlns.lamkamp.nl/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
	</channel>
</rss>
