The code is:
Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long
Sub CreateFolder()
MakeSureDirectoryPathExists Application.DefaultFilePath & "\YOURFOLDER\"
End Sub
where \YOURFOLDER\ is the name of the folder whose existence you want to ensu note trailing \.
"escorido " wrote:
Hello to all,
How to check if the folder exist in the ActiveWorkbook.Path directory,
if it doesn't, create the folder there?
Could anyone show some sample codes on how to do this?
I'm still new to ExcelVBA and not familiar with it.
Thanks a lot!
---
Message posted from http://www.ExcelForum.com/