Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On error resume next
mkdir ActiveWorkbook.Path & "\myfolder" On Error goto 0 -- Regards, Tom Ogilvy "escorido " wrote in message ... 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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check for a tab if it is exist | Excel Discussion (Misc queries) | |||
How to check if a folder/directory exist using VBA | Excel Programming | |||
Check if pivot already exist | Excel Programming | |||
Check if pivot already exist | Excel Programming | |||
check if a worksheet exist - VBA | Excel Programming |