Creating macro on how to save file within Excel file 
Author Message
 Creating macro on how to save file within Excel file

Hi Everyone,

I need some help on how to create macro to save file
(specifically on .csv extension) on specific destination
(LAN drive) with the filename uses the system date, like
for example:  L:\abc\January2003XXXX.csv.  How do I do
this? can anybody help me on this please?

Thanks in advance for your help.

Regards
Eric



Sun, 10 Jul 2005 21:15:34 GMT  
 Creating macro on how to save file within Excel file
Try this

Sub SaveAsCSV()
    Dim Temp
    Temp = Format(Date, "mmm-dd-yyyy")
    Temp = "L:\ABC\" & Temp & ".csv"
    ChDir "L:\ABC"
    ActiveWorkbook.SaveAs Filename:=Temp, FileFormat:=xlCSV, _
        CreateBackup:=False
End Sub

You may wish to change date format

Quote:

>Hi Everyone,

>I need some help on how to create macro to save file
>(specifically on .csv extension) on specific destination
>(LAN drive) with the filename uses the system date, like
>for example:  L:\abc\January2003XXXX.csv.  How do I do
>this? can anybody help me on this please?

>Thanks in advance for your help.

>Regards
>Eric

Anti Spam Signature - replace .net with .com


Sun, 10 Jul 2005 21:38:21 GMT  
 Creating macro on how to save file within Excel file
David,

I haven't tried it in a macro, but I don't think it's necessary to append
".csv" onto the file name.  The CSV file type specified will cause Excel to
do that (as long as the given file name does not end with a period).

Just thought I'd mention it.

Regards from {*filter*}ia Beach,

EarlK
-------------------------------------------------------------


Quote:
> Try this

> Sub SaveAsCSV()
>     Dim Temp
>     Temp = Format(Date, "mmm-dd-yyyy")
>     Temp = "L:\ABC\" & Temp & ".csv"
>     ChDir "L:\ABC"
>     ActiveWorkbook.SaveAs Filename:=Temp, FileFormat:=xlCSV, _
>         CreateBackup:=False
> End Sub

> You may wish to change date format


> >Hi Everyone,

> >I need some help on how to create macro to save file
> >(specifically on .csv extension) on specific destination
> >(LAN drive) with the filename uses the system date, like
> >for example:  L:\abc\January2003XXXX.csv.  How do I do
> >this? can anybody help me on this please?

> >Thanks in advance for your help.

> >Regards
> >Eric

> Anti Spam Signature - replace .net with .com



Sun, 10 Jul 2005 23:13:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Specify File Name for Saving within a Macro

2. saving a file as HTML from within a macro

3. saving a file as HTML from within a macro

4. Saving files within a macro

5. Saving a file within a macro

6. Cannot open Excel file even though it was created and saved in Excel

7. enable and disable File-save and File-save-as-Dialog in Excel 97 and 2000

8. enable and disable File-save and File-save-as-Dialog in Excel 97 and 2000

9. Saving an image/picture within an excel worksheet as a .bmp/.gif/.jpg file

10. Excel / excel macros created within Visual Basic


 
Powered by phpBB® Forum Software © phpBB Group