<?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: Need to trap &#8220;File Not Found&#8221; error when testing path string</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/need-to-trap-file-not-found-error-when-testing-path-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/need-to-trap-file-not-found-error-when-testing-path-string/</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jun 2013 05:22:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: stiletto</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/need-to-trap-file-not-found-error-when-testing-path-string/#comment-43905</link>
		<dc:creator>stiletto</dc:creator>
		<pubDate>Tue, 24 Apr 2007 10:58:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-43905</guid>
		<description><![CDATA[CharlesJC, I think you may have miskeyed.  I think the error number is 53.  AKA ErrFileNotFound if using lserr.lss
]]></description>
		<content:encoded><![CDATA[<p>CharlesJC, I think you may have miskeyed.  I think the error number is 53.  AKA ErrFileNotFound if using lserr.lss</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brooklynegg</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/need-to-trap-file-not-found-error-when-testing-path-string/#comment-43906</link>
		<dc:creator>brooklynegg</dc:creator>
		<pubDate>Tue, 24 Apr 2007 10:13:28 +0000</pubDate>
		<guid isPermaLink="false">#comment-43906</guid>
		<description><![CDATA[Stilleto: Agreed. mHanson should be able to put in a generic error handler and this line to find out the error number, 

Messagebox &quot;Error&quot; &amp; Str(Err) &amp; &quot;: &quot; &amp; Error$

...then code a specific action to occur when that number is encountered. In my example below, error 75 is returned if I try to access  a folder that does not exist and my code creates the new folder (I actually can&#039;t remember exactly how it does it, but I know it works).

Example:

On Error Goto Errhandle
....code here

Exit Sub
Errhandle:    
   &#039; Use the Err function to return the error number and 
   &#039; the Error$ function to return the error message.
If Err = 75 Then 
	Resume Next
Else
	Messagebox &quot;Error&quot; &amp; Str(Err) &amp; &quot;: &quot; &amp; Error$
	Exit Sub
End If
End Sub]]></description>
		<content:encoded><![CDATA[<p>Stilleto: Agreed. mHanson should be able to put in a generic error handler and this line to find out the error number, </p>
<p>Messagebox &#8220;Error&#8221; &amp; Str(Err) &amp; &#8220;: &#8221; &amp; Error$</p>
<p>&#8230;then code a specific action to occur when that number is encountered. In my example below, error 75 is returned if I try to access  a folder that does not exist and my code creates the new folder (I actually can&#8217;t remember exactly how it does it, but I know it works).</p>
<p>Example:</p>
<p>On Error Goto Errhandle<br />
&#8230;.code here</p>
<p>Exit Sub<br />
Errhandle:<br />
   &#8216; Use the Err function to return the error number and<br />
   &#8216; the Error$ function to return the error message.<br />
If Err = 75 Then<br />
	Resume Next<br />
Else<br />
	Messagebox &#8220;Error&#8221; &amp; Str(Err) &amp; &#8220;: &#8221; &amp; Error$<br />
	Exit Sub<br />
End If<br />
End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charlesjc</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/need-to-trap-file-not-found-error-when-testing-path-string/#comment-43907</link>
		<dc:creator>charlesjc</dc:creator>
		<pubDate>Tue, 24 Apr 2007 10:07:04 +0000</pubDate>
		<guid isPermaLink="false">#comment-43907</guid>
		<description><![CDATA[mHanson,

  You could try using the Dir$ function to test the validity of paths and file names. For example, 

If Dir$(msg$)  &quot;&quot; then
  &#039;process the file
Esle
  &#039;handle your incorrect information
  Messagebox &quot;File &quot;&quot;&quot; &amp; msg$ &amp; &quot;&quot;&quot; not found.&quot;
End If

This should be placed before your call to GetFileAttr.

  Also, why didn&#039;t trapping Err = 5 (File Not Found) work?

Charles]]></description>
		<content:encoded><![CDATA[<p>mHanson,</p>
<p>  You could try using the Dir$ function to test the validity of paths and file names. For example, </p>
<p>If Dir$(msg$)  &#8220;&#8221; then<br />
  &#8216;process the file<br />
Esle<br />
  &#8216;handle your incorrect information<br />
  Messagebox &#8220;File &#8220;&#8221;" &amp; msg$ &amp; &#8220;&#8221;" not found.&#8221;<br />
End If</p>
<p>This should be placed before your call to GetFileAttr.</p>
<p>  Also, why didn&#8217;t trapping Err = 5 (File Not Found) work?</p>
<p>Charles</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.042 seconds using memcached
Object Caching 295/301 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-18 05:38:12 -->