<?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: Robust VBA Save-As Technique</title>
	<atom:link href="http://peltiertech.com/WordPress/robust-vba-save-as-technique/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Thu, 09 Sep 2010 18:18:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Bryan</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-24768</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Thu, 31 Dec 2009 14:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-24768</guid>
		<description>Thank you.  This worked great.</description>
		<content:encoded><![CDATA[<p>Thank you.  This worked great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-24755</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Thu, 31 Dec 2009 06:21:49 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-24755</guid>
		<description>Bryan -

If the file was imported as a CSV file, you have to tell Excel what format to save it in:

ActiveWorkbook.SaveAs TheFile, xlWorkbookNormal</description>
		<content:encoded><![CDATA[<p>Bryan -</p>
<p>If the file was imported as a CSV file, you have to tell Excel what format to save it in:</p>
<p>ActiveWorkbook.SaveAs TheFile, xlWorkbookNormal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-24713</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Wed, 30 Dec 2009 22:01:19 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-24713</guid>
		<description>Thank you.  This is going through the steps and saving my file, but when i go to re-open the file that was saved, I get a corrupt error saying that the file type is not correct.  Here is my code:

Sub SelectSaveFileName()
    Dim TheFile As Variant
        
    
    TheFile = Application.GetSaveAsFilename(Sheets(&quot;Test Report&quot;).Range(&quot;$B$4&quot;).Value &amp; &quot;.xls&quot;, _
        &quot;Workbook (*.xls), *.xls&quot;, , &quot;Please save you file:&quot;) &#039; SELECTS THE CELL AS THE FILE NAME

    If TheFile = False Then
    MsgBox &quot;You cancelled; Your file was NOT saved!&quot;
    

    Else
    ActiveWorkbook.SaveAs TheFile
        MsgBox &quot;You have saved &quot; &amp; CStr(TheFile)
    End If


End Sub

The file I run my macro on starts as a CSV file, but I want to save as an xls file.  Do you see any issues with this?  The macro is on my personal.xls now, but i want to in the end deploy as an addin.  This is just the save subroutine from my macro--it is much longer.  Thanks!
Bryan</description>
		<content:encoded><![CDATA[<p>Thank you.  This is going through the steps and saving my file, but when i go to re-open the file that was saved, I get a corrupt error saying that the file type is not correct.  Here is my code:</p>
<p>Sub SelectSaveFileName()<br />
    Dim TheFile As Variant</p>
<p>    TheFile = Application.GetSaveAsFilename(Sheets(&#8220;Test Report&#8221;).Range(&#8220;$B$4&#8243;).Value &amp; &#8220;.xls&#8221;, _<br />
        &#8220;Workbook (*.xls), *.xls&#8221;, , &#8220;Please save you file:&#8221;) &#8216; SELECTS THE CELL AS THE FILE NAME</p>
<p>    If TheFile = False Then<br />
    MsgBox &#8220;You cancelled; Your file was NOT saved!&#8221;</p>
<p>    Else<br />
    ActiveWorkbook.SaveAs TheFile<br />
        MsgBox &#8220;You have saved &#8221; &amp; CStr(TheFile)<br />
    End If</p>
<p>End Sub</p>
<p>The file I run my macro on starts as a CSV file, but I want to save as an xls file.  Do you see any issues with this?  The macro is on my personal.xls now, but i want to in the end deploy as an addin.  This is just the save subroutine from my macro&#8211;it is much longer.  Thanks!<br />
Bryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-24357</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 22 Dec 2009 20:10:26 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-24357</guid>
		<description>Bryan -

Do you just want to save the file, or do you want to present the user with a default file name that they can change?

If you&#039;re just saving the file, skip the dialog altogether. To insert a default file name into the Save As dialog, use this syntax:

Application.Dialogs(xlDialogSaveAs).Show arg1:=&quot;C:\my documents\test.xls&quot;

(Thanks to Dave Peterson, whose answer to the same question appeared in several places, including http://www.pcreview.co.uk/forums/thread-966348.php).</description>
		<content:encoded><![CDATA[<p>Bryan -</p>
<p>Do you just want to save the file, or do you want to present the user with a default file name that they can change?</p>
<p>If you&#8217;re just saving the file, skip the dialog altogether. To insert a default file name into the Save As dialog, use this syntax:</p>
<p>Application.Dialogs(xlDialogSaveAs).Show arg1:=&#8221;C:\my documents\test.xls&#8221;</p>
<p>(Thanks to Dave Peterson, whose answer to the same question appeared in several places, including <a href="http://www.pcreview.co.uk/forums/thread-966348.php)" rel="nofollow">http://www.pcreview.co.uk/forums/thread-966348.php)</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-24356</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Tue, 22 Dec 2009 20:04:39 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-24356</guid>
		<description>But, can I used the built in Save-As dialog if i want to specify with the code what the file name will be?</description>
		<content:encoded><![CDATA[<p>But, can I used the built in Save-As dialog if i want to specify with the code what the file name will be?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-24355</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 22 Dec 2009 19:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-24355</guid>
		<description>Bryan -

At the top of the article, I do state that if you don&#039;t need much functionality around the save-as routine, you could use Excel&#039;s built-in Save-As dialog.

GetSaveAsFileName is not designed to save a file, it&#039;s designed to get the save-as file name. This allows the code to do various things before saving, and even skip the save if that&#039;s what the programmer intended. This particular routine checks for duplicate file names, but it could instead automatically overwrite the existing file, or append duplicates with -1, -2, etc., or even append a date .

You might notics a line that says

ActiveWorkbook.SaveAs sFullName

This is the command that actually saves the workbook.</description>
		<content:encoded><![CDATA[<p>Bryan -</p>
<p>At the top of the article, I do state that if you don&#8217;t need much functionality around the save-as routine, you could use Excel&#8217;s built-in Save-As dialog.</p>
<p>GetSaveAsFileName is not designed to save a file, it&#8217;s designed to get the save-as file name. This allows the code to do various things before saving, and even skip the save if that&#8217;s what the programmer intended. This particular routine checks for duplicate file names, but it could instead automatically overwrite the existing file, or append duplicates with -1, -2, etc., or even append a date .</p>
<p>You might notics a line that says</p>
<p>ActiveWorkbook.SaveAs sFullName</p>
<p>This is the command that actually saves the workbook.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-24351</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Tue, 22 Dec 2009 19:27:04 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-24351</guid>
		<description>Hello, the code above seems to very long to achieve such a simple things.  I have used the Application.GetSaveAs function, and was also able to specify what the title will be.  However, I cannot for the life of me get it to actually save.  Isn&#039;t there some code that would save the file as the new file name and type right after the user pressed &quot;save&quot; from the dialog box?  I placed and &quot;application.save&quot; in the code so when the user presses save, it saves it, but it doesn&#039;t do what I would like.  Any help?</description>
		<content:encoded><![CDATA[<p>Hello, the code above seems to very long to achieve such a simple things.  I have used the Application.GetSaveAs function, and was also able to specify what the title will be.  However, I cannot for the life of me get it to actually save.  Isn&#8217;t there some code that would save the file as the new file name and type right after the user pressed &#8220;save&#8221; from the dialog box?  I placed and &#8220;application.save&#8221; in the code so when the user presses save, it saves it, but it doesn&#8217;t do what I would like.  Any help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-23584</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 08 Dec 2009 12:09:31 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-23584</guid>
		<description>In a quick test on my office network, I was able to use FileExists to check for a file on another share, using &lt;tt style=&quot;tt&quot;&gt;\\share\path\file.ext&lt;/tt&gt; addressing.</description>
		<content:encoded><![CDATA[<p>In a quick test on my office network, I was able to use FileExists to check for a file on another share, using <tt style="tt">\\share\path\file.ext</tt> addressing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Karel Pieterse</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-23569</link>
		<dc:creator>Jan Karel Pieterse</dc:creator>
		<pubDate>Tue, 08 Dec 2009 06:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-23569</guid>
		<description>Does the FileExists function work on UNC paths too?</description>
		<content:encoded><![CDATA[<p>Does the FileExists function work on UNC paths too?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/robust-vba-save-as-technique/comment-page-1/#comment-23565</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 08 Dec 2009 04:26:43 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2708#comment-23565</guid>
		<description>Thanks, Bob. Good point. Also have to make sure that we allow the file being saved to already have the selected name, so it&#039;s even a bit more intricate. When I get a moment, I&#039;ll tweak the code.</description>
		<content:encoded><![CDATA[<p>Thanks, Bob. Good point. Also have to make sure that we allow the file being saved to already have the selected name, so it&#8217;s even a bit more intricate. When I get a moment, I&#8217;ll tweak the code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
