Following is an extract of the script that I have. I want to create a path on network G drive for which I have all access and I get PATH NOT FOUND error message. That script used to work before and I can't get it to work again. Is there an other way of "rephrasing" the MKDIR portion of that script.
Anybody can tell me what's wrong.
Please also see thread707-665173
Dim CurrentVendorNo As String
Dim NextVendorNo As String
Dim FolderName As String
'Define the folder name
FolderName = Replace(ActiveWorkbook.Name, ".xls", ""
'Create directories
Do
'Compare both records
CurrentBuyerNo = Range("A" + CStr(i)).Value
NextBuyerNo = Range("A" + CStr(i + 1)).Value
If Not (CurrentBuyerNo = NextBuyerNo) Then
MkDir "G:\Department Shared Data\Purchasing\COMMON\" + FolderName + "\" + "BUYER " + CurrentBuyerNo
End If
i = i + 1
'Do until record is empty
Loop Until Range("A" + CStr(i)) = ""
The script does a whole lot more than just what up here but this is the first step. As mentioned before, I can run it in two passes, first one by deleting red portion of script and then reinserting it and running the code again.
Thanks for any suggestions.
Anybody can tell me what's wrong.
Please also see thread707-665173
Dim CurrentVendorNo As String
Dim NextVendorNo As String
Dim FolderName As String
'Define the folder name
FolderName = Replace(ActiveWorkbook.Name, ".xls", ""
'Create directories
Do
'Compare both records
CurrentBuyerNo = Range("A" + CStr(i)).Value
NextBuyerNo = Range("A" + CStr(i + 1)).Value
If Not (CurrentBuyerNo = NextBuyerNo) Then
MkDir "G:\Department Shared Data\Purchasing\COMMON\" + FolderName + "\" + "BUYER " + CurrentBuyerNo
End If
i = i + 1
'Do until record is empty
Loop Until Range("A" + CStr(i)) = ""
The script does a whole lot more than just what up here but this is the first step. As mentioned before, I can run it in two passes, first one by deleting red portion of script and then reinserting it and running the code again.
Thanks for any suggestions.