<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Opening the Newest File in a Folder with VBA</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Matt</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/#comment-39226</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 05 May 2009 00:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2407#comment-39226</guid>
		<description>&lt;p&gt;A possible alternative approach provided &quot;I almost never want the CSV to remain on the disk&quot; and the exported data is reasonably similar in format:&lt;br&gt;
Export to the same file name each time and set up a workbook with a query to the csv file as an external data source.  Export the file, refresh the query and manipulate as required.  If sets of similar data are being exported then pivot tables or other analysis tools can be left setup in the workbook and simply refreshed with the new data.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>A possible alternative approach provided &#8220;I almost never want the CSV to remain on the disk&#8221; and the exported data is reasonably similar in format:<br />
Export to the same file name each time and set up a workbook with a query to the csv file as an external data source.  Export the file, refresh the query and manipulate as required.  If sets of similar data are being exported then pivot tables or other analysis tools can be left setup in the workbook and simply refreshed with the new data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/#comment-39207</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Sun, 03 May 2009 18:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2407#comment-39207</guid>
		<description>&lt;p&gt;An easier way? How about running a console command?&lt;/p&gt;
&lt;p&gt;for /F %%a in (&#039;dir /b/o-d &quot;directorynamehere*.csv&quot;&#039;) do (start %%a &amp; exit)&lt;/p&gt;
&lt;p&gt;Use VBA&#039;s Shell function to run it.&lt;/p&gt;
&lt;p&gt;This is what command processors and shells were meant to do. Trying to do the same thing with any procedural language (no matter how much OO is piled onto it) requires lots more code.&lt;/p&gt;
&lt;p&gt;If all you have is a hammer, all problems look like nails.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>An easier way? How about running a console command?</p>
<p>for /F %%a in (&#8216;dir /b/o-d &#8220;directorynamehere*.csv&#8221;&#8216;) do (start %%a &amp; exit)</p>
<p>Use VBA&#8217;s Shell function to run it.</p>
<p>This is what command processors and shells were meant to do. Trying to do the same thing with any procedural language (no matter how much OO is piled onto it) requires lots more code.</p>
<p>If all you have is a hammer, all problems look like nails.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grigory</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/#comment-39206</link>
		<dc:creator>Grigory</dc:creator>
		<pubDate>Sun, 03 May 2009 17:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2407#comment-39206</guid>
		<description>&lt;p&gt;Here are a couple of relevant code snippets:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.j-walk.com/ss/excel/tips/tip97.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.j-walk.com/ss/excel/tips/tip97.htm&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Here are a couple of relevant code snippets:</p>
<p><a href="http://www.j-walk.com/ss/excel/tips/tip97.htm" rel="nofollow">http://www.j-walk.com/ss/excel/tips/tip97.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/#comment-39205</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Sun, 03 May 2009 15:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2407#comment-39205</guid>
		<description>&lt;p&gt;Some improvement:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; recentfile()&lt;br&gt;
&#160; c0 = Dir(&lt;span class=&quot;st0&quot;&gt;&quot;E:OF*.csv&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Do&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Until&lt;/span&gt; c0 = &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;with&lt;/span&gt; CreateObject(&lt;span class=&quot;st0&quot;&gt;&quot;scripting.filesystemobject&quot;&lt;/span&gt;).Getfile(c0)&lt;br&gt;
&#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; .datecreated &gt; c1 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; c1 = .datecreated&lt;br&gt;
&#160; &#160; &#160; &#160; c2 = c0&lt;br&gt;
&#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;with&lt;/span&gt;&lt;br&gt;
&#160; &#160; c0 = Dir&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Loop&lt;/span&gt;&lt;br&gt;
&#160; Workbooks.Add c2&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Some improvement:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> recentfile()<br />
&nbsp; c0 = Dir(<span class="st0">&#8220;E:OF*.csv&#8221;</span>)<br />
&nbsp; <span class="kw1">Do</span> <span class="kw1">Until</span> c0 = <span class="st0">&#8220;&#8221;</span><br />
&nbsp; &nbsp; <span class="kw1">with</span> CreateObject(<span class="st0">&#8220;scripting.filesystemobject&#8221;</span>).Getfile(c0)<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">If</span> .datecreated &amp;gt; c1 <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; c1 = .datecreated<br />
&nbsp; &nbsp; &nbsp; &nbsp; c2 = c0<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; <span class="kw1">end</span> <span class="kw1">with</span><br />
&nbsp; &nbsp; c0 = Dir<br />
&nbsp; <span class="kw1">Loop</span><br />
&nbsp; Workbooks.Add c2<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/#comment-39201</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Sat, 02 May 2009 15:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2407#comment-39201</guid>
		<description>&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; recentfile()&lt;br&gt;
&#160; c0 = Dir(&lt;span class=&quot;st0&quot;&gt;&quot;E:OF*.csv&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Do&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Until&lt;/span&gt; c0 = &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; CreateObject(&lt;span class=&quot;st0&quot;&gt;&quot;scripting.filesystemobject&quot;&lt;/span&gt;).Getfile(c0).datecreated &gt; c1 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; c1 = CreateObject(&lt;span class=&quot;st0&quot;&gt;&quot;scripting.filesystemobject&quot;&lt;/span&gt;).Getfile(c0).datecreated&lt;br&gt;
&#160; &#160; &#160; c2 = c0&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; c0 = Dir&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Loop&lt;/span&gt;&lt;br&gt;
&#160; Workbooks.Add c2&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> recentfile()<br />
&nbsp; c0 = Dir(<span class="st0">&#8220;E:OF*.csv&#8221;</span>)<br />
&nbsp; <span class="kw1">Do</span> <span class="kw1">Until</span> c0 = <span class="st0">&#8220;&#8221;</span><br />
&nbsp; &nbsp; <span class="kw1">If</span> CreateObject(<span class="st0">&#8220;scripting.filesystemobject&#8221;</span>).Getfile(c0).datecreated &amp;gt; c1 <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; c1 = CreateObject(<span class="st0">&#8220;scripting.filesystemobject&#8221;</span>).Getfile(c0).datecreated<br />
&nbsp; &nbsp; &nbsp; c2 = c0<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; c0 = Dir<br />
&nbsp; <span class="kw1">Loop</span><br />
&nbsp; Workbooks.Add c2<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Why Id like Python at work « Number Cruncher</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/#comment-39200</link>
		<dc:creator>Why Id like Python at work « Number Cruncher</dc:creator>
		<pubDate>Sat, 02 May 2009 15:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2407#comment-39200</guid>
		<description>&lt;p&gt;[...] Kusleika posted a VBA sub to open the newest file in a folder over at Daily Dose of Excel today, which made use of the Scripting library to iterate over .csv [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Kusleika posted a VBA sub to open the newest file in a folder over at Daily Dose of Excel today, which made use of the Scripting library to iterate over .csv [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geoff</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/01/opening-the-newest-file-in-a-folder-with-vba/#comment-39199</link>
		<dc:creator>geoff</dc:creator>
		<pubDate>Sat, 02 May 2009 10:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2407#comment-39199</guid>
		<description>&lt;p&gt;This is a very useful function. I think whatever you do to find the newest file you need to iterate over the .files collection to get the names and create dates, so you may not be able to avoid looping using vbscript.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is a very useful function. I think whatever you do to find the newest file you need to iterate over the .files collection to get the names and create dates, so you may not be able to avoid looping using vbscript.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

