I have a script where user is prompted a few questions then the script creates folders, saves excel files and emails them. It works beautifully. I want to offer the user the possibility of deleting the folder once the files have been mailed because those files are temporary and useless after they have been sent.
The confirmation msgbox below shows the right path which I copied to the RMDIR portion.
This is what the path looks like:
(G:\Department Shared Data\Purchasing\COMMON\60DAYS PERIOD 10FY04 NEW3).
The problem is although the folder does exist I get error message: Run time error '75'
ath/File access error.
Here is the portion of the script:
'Remove 60 Days directory
If Dir("G:\Department Shared Data\Purchasing\COMMON\" + "60DAYS PERIOD " & whatperiod & "FY" & Right(whatyear, 2) & " " & WhichVersion, vbDirectory) <> "" Then
confirmDel60 = msgbox("Do you wish to delete: " & "G:\Department Shared Data\Purchasing\COMMON\" + "60DAYS PERIOD " & whatperiod & "FY" & Right(whatyear, 2) & " " & WhichVersion, vbYesNo)
If confirmDel60 = 6 Then
RmDir "G:\Department Shared Data\Purchasing\COMMON\" + "60DAYS PERIOD " & whatperiod & "FY" & Right(whatyear, 2) & " " & WhichVersion
End If
Any suggestions anyone
The confirmation msgbox below shows the right path which I copied to the RMDIR portion.
This is what the path looks like:
(G:\Department Shared Data\Purchasing\COMMON\60DAYS PERIOD 10FY04 NEW3).
The problem is although the folder does exist I get error message: Run time error '75'
Here is the portion of the script:
'Remove 60 Days directory
If Dir("G:\Department Shared Data\Purchasing\COMMON\" + "60DAYS PERIOD " & whatperiod & "FY" & Right(whatyear, 2) & " " & WhichVersion, vbDirectory) <> "" Then
confirmDel60 = msgbox("Do you wish to delete: " & "G:\Department Shared Data\Purchasing\COMMON\" + "60DAYS PERIOD " & whatperiod & "FY" & Right(whatyear, 2) & " " & WhichVersion, vbYesNo)
If confirmDel60 = 6 Then
RmDir "G:\Department Shared Data\Purchasing\COMMON\" + "60DAYS PERIOD " & whatperiod & "FY" & Right(whatyear, 2) & " " & WhichVersion
End If
Any suggestions anyone