Anyone, and everyone
I have a macro to save my spreadsheet. (I am saving it several times
with diffrent names based on the data the macro pulls)
The code is as follows:
ActiveWorkbook.SaveAs Filename:= _
quot;I:\Commercial\0607\BVS\Master Bvs\ANU20.xlsquot;,
FileFormat:=xlNormal _
, Password:=quot;quot;, WriteResPassword:=quot;quot;,
ReadOnlyRecommended:=False, _
CreateBackup:=False
Heres the trick,
When it runs through its 5 times, every now and then I get a error 1004
message and the file is not saved. Now this can happen at any stage of
the macro and has no rhyme or reason (That I can see)
What do think? Is there a better way to do this?
Dougwould it relate to the file name you are trying to use (possibly
illegal?)Don't Think so. Sometimes the first 4 of these run and it fails on the
5th. Somethimes it fails on the first. They are all saved to the same
area just under different names.If, after the failure, the workbook ceases to be able to be saved quot;anywherequot;,
then your trouble may be coming from network hits occuring at random times,
not really even related to your macro.....
One thing you might try is to put this macro in a TEST workbook and see if
it reacts the same, saving to your local drive directories rather than the
network.
Vaya con Dios
Chuck, CABGx3
quot; wrote:
gt; Anyone, and everyone
gt;
gt; I have a macro to save my spreadsheet. (I am saving it several times
gt; with diffrent names based on the data the macro pulls)
gt;
gt; The code is as follows:
gt;
gt;
gt;
gt; ActiveWorkbook.SaveAs Filename:= _
gt; quot;I:\Commercial\0607\BVS\Master Bvs\ANU20.xlsquot;,
gt; FileFormat:=xlNormal _
gt; , Password:=quot;quot;, WriteResPassword:=quot;quot;,
gt; ReadOnlyRecommended:=False, _
gt; CreateBackup:=False
gt;
gt; Heres the trick,
gt;
gt; When it runs through its 5 times, every now and then I get a error 1004
gt; message and the file is not saved. Now this can happen at any stage of
gt; the macro and has no rhyme or reason (That I can see)
gt;
gt; What do think? Is there a better way to do this?
gt;
gt; Doug
gt;
gt;
- Jul 20 Thu 2006 20:08
Macro Help for Saving a file
close
全站熱搜
留言列表
發表留言