abdulrahman1
New Member
- Joined
- Feb 8, 2018
- Messages
- 8
Hi all,
I am using a macro to create a folder. This is working perfectly. However, when I try to save something into that newly created file, I get a popup saying
"The file could not be accessed. Try one of the following..."
This is the macro used to create the new folder
Sub CreateORFolder()
'Variable definations
Dim ORFilesParentFolderPath As String
Dim ORFilesFolder As String
'Set the Folder where the individual folders should be created
ORFilesParentFolderPath = Range("C19").Value
ORFilesFolder = Range("E19").Value
If FileSystem.Dir(ORFilesFolder, vbDirectory) = vbNullString Then
FileSystem.MkDir ORFilesFolder
Else
MsgBox "Daily OR folder already exists. No action has been taken"
End If
End Sub
I'm on Excel 2007
I am using a macro to create a folder. This is working perfectly. However, when I try to save something into that newly created file, I get a popup saying
"The file could not be accessed. Try one of the following..."
This is the macro used to create the new folder
Sub CreateORFolder()
'Variable definations
Dim ORFilesParentFolderPath As String
Dim ORFilesFolder As String
'Set the Folder where the individual folders should be created
ORFilesParentFolderPath = Range("C19").Value
ORFilesFolder = Range("E19").Value
If FileSystem.Dir(ORFilesFolder, vbDirectory) = vbNullString Then
FileSystem.MkDir ORFilesFolder
Else
MsgBox "Daily OR folder already exists. No action has been taken"
End If
End Sub
I'm on Excel 2007