Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving File
Hi all I am wondering how to save a file automaitcally. How do I get excel
to check if there is a folder called "Darts" and if it does not already have one then it is to create one on the C drive? Thanks Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving File
Hi Greg,
Try something like: '============= Public Sub Tester() Dim WB As Workbook Const myDir As String = "C:\Darts" Const newFileName As String = "My File" '<<==== CHANGE Set WB = ActiveWorkbook '<<==== CHANGE On Error Resume Next MkDir myDir On Error GoTo 0 Application.DisplayAlerts = False WB.SaveAs Filename:=myDir & "\" & newFileName & ".xls", _ FileFormat:=xlWorkbookNormal Application.DisplayAlerts = True End Sub '<<============= --- Regards, Norman "Greg" wrote in message ... Hi all I am wondering how to save a file automaitcally. How do I get excel to check if there is a folder called "Darts" and if it does not already have one then it is to create one on the C drive? Thanks Greg |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving File
Great thanks for that
Greg "Norman Jones" wrote in message ... Hi Greg, Try something like: '============= Public Sub Tester() Dim WB As Workbook Const myDir As String = "C:\Darts" Const newFileName As String = "My File" '<<==== CHANGE Set WB = ActiveWorkbook '<<==== CHANGE On Error Resume Next MkDir myDir On Error GoTo 0 Application.DisplayAlerts = False WB.SaveAs Filename:=myDir & "\" & newFileName & ".xls", _ FileFormat:=xlWorkbookNormal Application.DisplayAlerts = True End Sub '<<============= --- Regards, Norman "Greg" wrote in message ... Hi all I am wondering how to save a file automaitcally. How do I get excel to check if there is a folder called "Darts" and if it does not already have one then it is to create one on the C drive? Thanks Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving Excel 2007 file in 2003 creates very large file | Excel Discussion (Misc queries) | |||
Text file saving, setting file origin | Excel Discussion (Misc queries) | |||
Saving multi-tab excel file created from comma delimited text file | Excel Programming | |||
How do I stop Excel 2000 from saving file history from file that . | Excel Discussion (Misc queries) | |||
saving an excel file as an ASCII text file without delimiters | Excel Programming |