<?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>Bacon Bits:</title>
	<atom:link href="http://datapigtechnologies.com/blog/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://datapigtechnologies.com/blog</link>
	<description>A DataPig Technologies Blog</description>
	<lastBuildDate>Sun, 01 Jan 2012 21:30:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Excel New Year Resolutions</title>
		<link>http://datapigtechnologies.com/blog/index.php/excel-new-year-resolutions/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/excel-new-year-resolutions/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 21:26:30 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[~ Bacon Bits]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/excel-new-year-resolutions/</guid>
		<description><![CDATA[Well folks, it&#8217;s officially the year 2012. And even though the Mayans have put a stigma on 2012 with all their &#8220;end of the world&#8221; mumbo jumbo, I&#8217;m very excited about the upcoming year. . This is the time for new-year&#8217;s resolutions. I was going to put down &#8220;stop procrastinating&#8221; on my list, but I [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Well folks, it&#8217;s officially the year 2012.  And even though the Mayans have put a stigma on 2012 with all their &#8220;end of the world&#8221; mumbo jumbo, I&#8217;m very excited about the upcoming year.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>This is the time for new-year&#8217;s resolutions.  I was going to put down &#8220;stop procrastinating&#8221; on my list, but I never got around to creating it.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>If you too have yet to create your list of new-year&#8217;s resolution&#8217;s, here are a few Excel resolutions you can adopt for 2012.
</p>
<ol>
<li>Stop emailing workbooks called Book1.xls
</li>
<li>Stop using Merge and Center
</li>
<li>Stop hiding cell content using White font
</li>
<li>Start making your workbooks Print-ready, so we don&#8217;t print 25 blank pages when we print it
</li>
<li>Stop printing Excel eye charts with 8 pitch font
</li>
</ol>
<p>Feel free to add your own.  Happy New Year!
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2012/01/010112_2126_ExcelNewYea1.jpg" alt=""/>
	</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/excel-new-year-resolutions/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Running a SQL Stored Procedure from Excel with Dynamic Parameters</title>
		<link>http://datapigtechnologies.com/blog/index.php/running-a-sql-stored-procedure-from-excel-with-dynamic-parameters/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/running-a-sql-stored-procedure-from-excel-with-dynamic-parameters/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 19:37:11 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Excel VBA]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Power Tips]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=3576</guid>
		<description><![CDATA[In my life-changing post, Running a SQL-Stored Procedure from Excel, I showed you how to make Excel interact with a SQL server Stored Procedure. . Since that post, I've had several requests to cover the topic of passing dynamic parameters to a Stored Procedure. So today, I will FINALLY show you. . Step 1: Data [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-excel-macro-from-access-or-another-excel-workbook/' rel='bookmark' title='Running an Excel Macro from Access (or Another Excel Workbook)'>Running an Excel Macro from Access (or Another Excel Workbook)</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-crosstab-queries-in-excel/' rel='bookmark' title='Running Crosstab Queries in Excel'>Running Crosstab Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/' rel='bookmark' title='Running an Access Parameter Query from Excel'>Running an Access Parameter Query from Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-a-zoom-box-in-excel/' rel='bookmark' title='Creating a Zoom Box in Excel'>Creating a Zoom Box in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/smart-scroll-bars-in-excel/' rel='bookmark' title='Smart Scroll Bars in Excel'>Smart Scroll Bars in Excel</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In my life-changing post, <a href="http://datapigtechnologies.com/blog/index.php/running-a-sql-stored-procedure-from-excel/">Running a SQL-Stored Procedure from Excel</a>, I showed you how to make Excel interact with a SQL server Stored Procedure.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>Since that post, I've had several requests to cover the topic of passing dynamic parameters to a Stored Procedure.  So today, I will FINALLY show you.
</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 1:  </strong>Data tab – &gt; From Other Sources -&gt; From SQL Server
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL1.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 2:  </strong>Enter Credentials.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL2.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 3:  </strong>Choose any small table or view. It doesn't matter which one because we'll be changing the connection anyway.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL3.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 4:  </strong>In the Data Connection Wizard dialog, give your connection a friendly name that you can remember.  This is how you'll point to this connection in VBA.  In this case, I'm calling this connection MYSERVER.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL4.png" alt=""/><span style="color:white"><br />
		</span></p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 5</strong>:  Excel will pop up the Import Data dialog box - Click <strong>Properties</strong> here (NOT THE OK BUTTON).
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL5.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 6:  </strong>Click on the Definition tab.  Here, you'll want to change Command Type to <strong>SQL</strong>, and then enter your Stored Procedure name in the Command Text input.  As you can see, the SQL statement is simply a call to the Stored Procedure along with the Parameter name (in this case, the procedure is expecting one parameter that accepts a market name).
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL6.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 7:</strong> Excel warns you about something unimportant - Click Yes (which in this case, means go away).
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL7.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 8:</strong> Excel will activate the Import Data dialog box again. This time click OK to fire the Stored Procedure and return the results.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL8.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 9:</strong> Note the results you get from your original hard-coded command you entered in Step 6.  At this point, you know your connection is working.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL9.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 10:</strong>  Create a mechanism to dynamically select and enter your parameters.
</p>
<p>In my case, I need to pass a market name to my Stored Procedure.  So I added a simple dropdown where my selection goes to Cell B2.  The mechanism you choose to select your parameters is not the important thing here.  The important thing is to note where the final selection will be housed.  In this example, my market selection will end up in Cell B2.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/121211_1936_RunningaSQL10.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><strong>Step 11:</strong>  The final step is to copy and paste this Macro into a standard module.  Notice that all we are dong here is changing the definition fo the CommandText property of the Connection. This basically means that as long as you can point to the correct connection (MYSERVER in this case), you can rebuild the CommandText on the fly.  Here, I'm rebuilding the CommandText to point to my chosen cell range (cell B2 - where my market selection is housed).
</p>
<p><div class="igBar"><span id="lvb-2"><a href="#" onclick="javascript:showPlainTxt('vb-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-2">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Sub</span> RefreshQuery<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">With</span> ActiveWorkbook.<span style="color: #66cc66;">Connections</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"MYSERVER"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">OLEDBConnection</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #66cc66;">CommandText</span> = <span style="color: #ff0000;">"EXECUTE dbo.Tng_Market_Feed '"</span> &amp; Range<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"B2"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Value</span> &amp; <span style="color: #ff0000;">"'"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">With</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ActiveWorkbook.<span style="color: #66cc66;">Connections</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"MYSERVER"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Refresh</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
<p><span style="color:white">.<br />
</span></p>
<p>At this point, it's just a question of firing the Macro each time your parameter selection changes.
</p>
<p>Now you're cooking with gas!</p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-excel-macro-from-access-or-another-excel-workbook/' rel='bookmark' title='Running an Excel Macro from Access (or Another Excel Workbook)'>Running an Excel Macro from Access (or Another Excel Workbook)</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-crosstab-queries-in-excel/' rel='bookmark' title='Running Crosstab Queries in Excel'>Running Crosstab Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/' rel='bookmark' title='Running an Access Parameter Query from Excel'>Running an Access Parameter Query from Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-a-zoom-box-in-excel/' rel='bookmark' title='Creating a Zoom Box in Excel'>Creating a Zoom Box in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/smart-scroll-bars-in-excel/' rel='bookmark' title='Smart Scroll Bars in Excel'>Smart Scroll Bars in Excel</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/running-a-sql-stored-procedure-from-excel-with-dynamic-parameters/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Buying Apps on Your Smart Phone</title>
		<link>http://datapigtechnologies.com/blog/index.php/buying-apps-on-your-smart-phone/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/buying-apps-on-your-smart-phone/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 13:01:29 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[~ Bacon Bits]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/buying-apps-on-your-smart-phone/</guid>
		<description><![CDATA[On this Friday, I'd like to share another life lesson from The Oatmeal: . No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>On this Friday, I'd like to share another life lesson from <a href="http://theoatmeal.com/" target="_blank">The Oatmeal:</a><br />
<span id="more-3565"></span>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/12/120211_1301_BuyingAppso1.png" alt=""/></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/buying-apps-on-your-smart-phone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Open CD Rom – The Most Useless API Call</title>
		<link>http://datapigtechnologies.com/blog/index.php/open-cd-rom-the-most-useless-api-call/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/open-cd-rom-the-most-useless-api-call/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 16:24:14 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Excel VBA]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=3551</guid>
		<description><![CDATA[Over the Thanksgiving holiday, I was ignoring the family and puttering around on the internet. There, I found a list of all the cool API calls you can do through VBA. An API call is essentially a piece of code you can use to make the Windows operating system do things – like open a [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/mocking-the-merge-center-icon/' rel='bookmark' title='Mocking the &#8216;Merge &amp; Center&#8217; Icon'>Mocking the &#8216;Merge &#038; Center&#8217; Icon</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-crosstab-queries-in-excel/' rel='bookmark' title='Running Crosstab Queries in Excel'>Running Crosstab Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/recordset-tricks-in-excel-1-filling-a-combobox-with-unique-values/' rel='bookmark' title='Recordset Tricks in Excel 1 – Filling a ComboBox with Unique Values'>Recordset Tricks in Excel 1 – Filling a ComboBox with Unique Values</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/sort-by-color-in-excel-2003/' rel='bookmark' title='Sort by Color in Excel 2003'>Sort by Color in Excel 2003</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Over the Thanksgiving holiday, I was ignoring the family and puttering around on the internet.  There, I found a list of all the cool API calls you can do through VBA.  An API call is essentially a piece of code you can use to make the Windows operating system do things – like open a directory, freeze the system, open a dialog box, etc.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>Well, there is an API Call that essentially opens your CD Rom drive.  That's right – you can implement code so you don't have to go through the painstaking task of pressing the Open button for your CD Rom drive.  Wow …. AUTOMATION IS THE BEST!
</p>
<p><span style="color:white">.<br />
</span></p>
<p>OK…this gets my vote for the most useless API call. Second place is the API call to close the CD Rom Drive.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>That being said, you could use this useless API to prank your coworkers.<br />
<span id="more-3551"></span>
</p>
<p>The trick is to implement the Open CD Rom API call so that every time they open Excel, the CD Rom pops so life.  Definitely good for weeks of annoyance and confusion.
</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="font-size:12pt"><strong>Step 1:</strong><br />
		</span></p>
<p>Go to their computer and navigate to the Visual Basic Editor in Excel and find their Personal Macro Workbook.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/11/112811_1624_OpenCDRomT1.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="font-size:12pt"><strong>Step2:<br />
</strong></span></p>
<p>In a new module, copy and paste this code:</p>
<div class="igBar"><span id="lvb-5"><a href="#" onclick="javascript:showPlainTxt('vb-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-5">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#If VBA7 <span style="color: #b1b100;">Then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Declare</span> PtrSafe <span style="color: #b1b100;">Function</span> mciSendString Lib <span style="color: #ff0000;">"winmm.dll"</span> Alias <span style="color: #ff0000;">"mciSendStringA"</span> _</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span>ByVal lpstrCommand <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span>, ByVal lpstrReturnString <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span>, _</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ByVal uReturnLength <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span>, ByVal hwndCallback <span style="color: #b1b100;">As</span> LongPtr<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#Else</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Declare</span> <span style="color: #b1b100;">Function</span> mciSendString Lib <span style="color: #ff0000;">"winmm.dll"</span> Alias <span style="color: #ff0000;">"mciSendStringA"</span> _</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span>ByVal lpCommandString <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span>, ByVal lpReturnString <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span>, _</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ByVal uReturnLength <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span>, ByVal hwndCallback <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#End <span style="color: #b1b100;">If</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><span style="color:white">.</span></p>
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/11/112811_1624_OpenCDRomT2.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="font-size:12pt"><strong>Step3:<br />
</strong></span></p>
<p>In the Workbook Open Event, copy and paste this code:</p>
<div class="igBar"><span id="lvb-6"><a href="#" onclick="javascript:showPlainTxt('vb-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-6">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Private</span> <span style="color: #b1b100;">Sub</span> Workbook_Open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> retval <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">retval = mciSendString<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"set CDAudio door open"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><span style="color:white">.</span></p>
<p> </p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/11/112811_1624_OpenCDRomT3.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="font-size:12pt"><strong>Step4:<br />
</strong></span></p>
<p>Save the changes to the Personal Macro Workbook and close Excel.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>The Evil deed has been done.  Every time Excel is opened, the CD Rom drive will pop to life.
</p>
<p>Now you can sit back and see how long your victim will live with this crazy opening CD Drive before either fixing it or re-imaging the machine.
</p>
<p>
 </p>
<p>
 </p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/mocking-the-merge-center-icon/' rel='bookmark' title='Mocking the &#8216;Merge &amp; Center&#8217; Icon'>Mocking the &#8216;Merge &#038; Center&#8217; Icon</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-crosstab-queries-in-excel/' rel='bookmark' title='Running Crosstab Queries in Excel'>Running Crosstab Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/recordset-tricks-in-excel-1-filling-a-combobox-with-unique-values/' rel='bookmark' title='Recordset Tricks in Excel 1 – Filling a ComboBox with Unique Values'>Recordset Tricks in Excel 1 – Filling a ComboBox with Unique Values</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/auto-adjust-chart-label-positions/' rel='bookmark' title='Auto Adjust Chart Label Positions'>Auto Adjust Chart Label Positions</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/sort-by-color-in-excel-2003/' rel='bookmark' title='Sort by Color in Excel 2003'>Sort by Color in Excel 2003</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/open-cd-rom-the-most-useless-api-call/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Happy Thanksgiving 2011</title>
		<link>http://datapigtechnologies.com/blog/index.php/happy-thanksgiving-2011/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/happy-thanksgiving-2011/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 10:42:16 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[~ Bacon Bits]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/happy-thanksgiving-2011/</guid>
		<description><![CDATA[Happy Thanksgiving to all you Excel Nerds out there. I hope you all enjoy your time with family and friends. . I'll return next week with more stuff. No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Happy Thanksgiving to all you Excel Nerds out there.
</p>
<p>I hope you all enjoy your time with family and friends.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/11/112211_1042_HappyThanks1.gif" alt=""/>
	</p>
</p>
<p><span style="color:white">.<br />
</span></p>
<p>I'll return next week with more stuff.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/happy-thanksgiving-2011/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

