View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
MB[_5_] MB[_5_] is offline
external usenet poster
 
Posts: 1
Default GetSaveAs Method

This is okay, but I want user input to confirm the new
directory name.
-----Original Message-----
Try this

Sub MakeDirectory()
Dim Dirname As String
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
Dirname = "C:\MyDir"
If Not fs.FolderExists(Dirname) Then
fs.CreateFolder Dirname
Else
' do nothing
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"M. Barnes" wrote

in message ...
Is there a way to create the folder if the suggested

path
does not exist? In other words, search for the

suggested
folder first, if it doesn't exist, the system will
prompt "That folder does not exist, do you wish to

create
it?".

I've seen this happen in other programs, and desire to
add it to mine. I'm currently using the GetSaveAs
method, but am not sure if it is the best way.

Thanks for any help you can provide.



.