Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
mkdir
Does anyone have any idea why this doesn't work? I keep getting a Path
not found (Error 76) message and the mkdir (save_path2) part of the code highlighted. If Dir(save_path2, vbDirectory) = "" Then MkDir (save_path2) Thanks, Peter |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
mkdir
If Dir(save_path2, vbDirectory) = "" Then MkDir save_path2
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Peter" wrote in message ups.com... Does anyone have any idea why this doesn't work? I keep getting a Path not found (Error 76) message and the mkdir (save_path2) part of the code highlighted. If Dir(save_path2, vbDirectory) = "" Then MkDir (save_path2) Thanks, Peter |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
mkdir
"Peter" wrote:
Does anyone have any idea why this doesn't work? I keep getting a Path not found (Error 76) message and the mkdir (save_path2) part of the code highlighted. If Dir(save_path2, vbDirectory) = "" Then MkDir (save_path2) Thanks, Peter You can also check if the parent folder exists before you use MkDir Sub test() Set fso = CreateObject _ ("Scripting.FileSystemObject") save_path2 = "C:\blah\myDir" parentFolder = fso.GetParentFolderName(save_path2) If fso.FolderExists(parentFolder) _ And Not fso.FolderExists(save_path2) Then MkDir save_path2 Else MsgBox "Could not create folder" End If End Sub Hope this helps. -- urkec |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MKDir not working | Excel Programming | |||
MkDir and Save As | Excel Programming | |||
mkdir problem | Excel Programming | |||
mkdir problem | Excel Programming | |||
MkDir error | Excel Programming |