Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Hi All,
I'm trying to create a folder from an excel in using the following code:
It used to work really great before I migrated over to the 365 Microsoft platform.
I'm now getting an error on line:
Can someone help me with the code?
Thanks!
Pinaceous
I'm trying to create a folder from an excel in using the following code:
VBA Code:
Sub Creaolders()
Dim sPath As String, sMain As String, sFolder As String
Dim i As Long
sPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
sMain = sPath & "\" & Sheets(1).Range("A1").Value
If Dir(sMain) = "" Then
MkDir sMain
'Add file Test.pdf from "C:\MISC\Test.pdf"
End If
End Sub
It used to work really great before I migrated over to the 365 Microsoft platform.
I'm now getting an error on line:
VBA Code:
If Dir(sMain) = "" Then
Can someone help me with the code?
Thanks!
Pinaceous