View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Make a directory on the fly

Here is a sub I use to create a directory and save a backup file in that
directory. Modify to suit.

Sub Backup() 'kept in personal.xls & assigned to toolbar button
On Error GoTo BackupFile
MkDir CurDir & "\Backup"
BackupFile:
With ActiveWorkbook
MyWB = .Path & "\BACKUP\" & .Name
.SaveCopyAs MyWB
.Save
End With
End Sub

--
Don Guillett
SalesAid Software

"Jonefer" wrote in message
...
I'm trying to write a vb routine that will save a file in
a certain directory. I want to test for the existence of
the directory and create it if it doesn't exist, before
saving the file.

please help?
Thanks