Dim strFolder As String
strFolder = "C:\New Folder"
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
‘Check whether the folder exists
If Not fso.FolderExists(strFolder) Then
FileSystem.MkDir (strFolder)
End If
Web Development and Programming Blog
Get paid for your opinions! Click on the banner above to join Planet Pulse. Its totally free to sign up, and you can earn UNLIMITED. Find out more by visiting PLANET PULSE. |
4 comments:
Thanks.
I've used Access for years but never had the occasion where I needed to create a folder with VBA. I was normally the person that would set everything up for the user, so I didn't have to worry about it. This worked perfectly. I tried various methods that did work and even modified a few of them and nothing. This was perfect.
Thanks.
Tim (Nashville, TN)
thanx!!!
I was looking this for days
Could you possibly detail where to put this code, and how to call it from, say, a macro? Thanks.
Hi AlanK, it is a sample code to create folder in windows through visual basic M.S. Access
Post a Comment