ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating Directories (https://www.excelbanter.com/excel-programming/302248-creating-directories.html)

Keith[_11_]

Creating Directories
 
I am looking for a way to check if a directory exists on a
machine. If it dosn't I want to create it.

Can anybody help?

Norman Jones

Creating Directories
 
Hi Keith,

On Error Resume Next
MkDir "C:\YourNewFolderName"
On Error GoTo 0

---
Regards,
Norman



"Keith" wrote in message
...
I am looking for a way to check if a directory exists on a
machine. If it dosn't I want to create it.

Can anybody help?




Papou

Creating Directories
 
Hi Keith
On Error Resume Next
ChDir "C:\Papou"
If Err < 0 Then MkDir "C:\Papou"

HTH
Cordially
Pascal

"Keith" a écrit dans le message de
...
I am looking for a way to check if a directory exists on a
machine. If it dosn't I want to create it.

Can anybody help?




sarasta[_2_]

Creating Directories
 
Well, I've coded that way :

Set a = CreateObject("Scripting.FileSystemObject")

If a.folderexists("c:\temp") Then

Else
a.createfolder ("c:\temp")
End I

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com