#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel 2007 file in 2003 creates very large file Jon Pearce Excel Discussion (Misc queries) 2 July 16th 09 07:20 PM
Text file saving, setting file origin mauddib Excel Discussion (Misc queries) 0 May 25th 06 02:50 PM
Saving multi-tab excel file created from comma delimited text file Marcus Aurelius Excel Programming 2 December 19th 05 05:16 PM
How do I stop Excel 2000 from saving file history from file that . Cathy Excel Discussion (Misc queries) 0 March 29th 05 03:27 PM
saving an excel file as an ASCII text file without delimiters Sewellst Excel Programming 4 January 7th 05 01:41 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"