MkDir

Sigma248

Registered User.
Local time
Today, 06:22
Joined
Oct 6, 2008
Messages
24
I am trying to use the MkDir function to make a new subfolder of an existing folder path:

Public Sub Create_Folder(Job_Name As String)

Dim Folder_Path as String

Folder_Path = "C:\Dean\Documents\Work\" & Job_Name

MkDir (Folder_Path)

end Sub

where "C:\Dean\Documents\Work" is an existing folder structure.

When the Sub is called I get:

Run-time error '76':

Path not found.

What am I doing wrong?
 
try

Code:
Folder_Path = "C:\Dean\Documents\Work\'" & Job_Name & '"
 
Tried that and got the same error message.
 
Howzit
This indicates to me that the main directory does not exist.

From windows: Start \ Run \ C:\Dean\Documents\Work

Does this open an explorer window? I know you said it does exist, but trying to eliminate the impossible.

Also need to get more info. What are the values of the two variables? These will show in the immediate window.

Code:
Public Sub Create_Folder(Job_Name As String)
stop
Dim Folder_Path as String

debug.print Job_Name

Folder_Path = "C:\Dean\Documents\Work\" & Job_Name & "'"

debug.print Folder_Path

MkDir (Folder_Path) 

end Sub
 
Howzit

Sorry have to dash - off on holiday. Love to complete this but I'll miss my plane. Someone else will be able to kick in from here if you still have problems.
 
Problem Solved: I had the wrong folder path - simple when you see the error.

Thanks to those who responded.
 

Users who are viewing this thread

Back
Top Bottom