DragonWood
Board Regular
- Joined
- Oct 17, 2010
- Messages
- 97
Ok, I’m a little lost.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I’m trying to save my file to a location based on the values of a few cells. I have the following code so far:<o></o>
<o></o>
<o></o>
I keep getting an error saying the path is not found and the MkDir line is highlighted.<o></o>
<o></o>
I can’t see where I did something wrong.<o></o>
<o></o>
I’m trying to save my file to a location based on the values of a few cells. I have the following code so far:<o></o>
Rich (BB code):
Sub SaveToFolder()
'Saves the file to a set folder path based on the cell values on the General Information page<o:p></o:p>
Dim fileSaveName As String
Dim jobSaveName As String
Dim foldSaveName As String
Dim dirSaveName As String<o:p></o:p>
fileSaveName = Sheets("General Information").Range("B4").Value
jobSaveName = Sheets("General Information").Range("B4").Value
foldSaveName = Sheets("General Information").Range("B8").Value
dirSaveName = Sheets("General Information").Range("B2").Value<o:p></o:p>
MkDir "C:\Test" & "\" & "Files" & "\" & dirSaveName & "\" & foldSaveName & "\" & jobSaveName<o:p></o:p>
ActiveWorkbook.SaveAs Filename:="C:\Neset\Wells\" & dirSaveName & "\" & foldSaveName & "\" & jobSaveName & “\” & fileSaveName & ".xlsm"<o:p></o:p>
End Sub<o:p></o:p>
<o></o>
I keep getting an error saying the path is not found and the MkDir line is highlighted.<o></o>
<o></o>
I can’t see where I did something wrong.<o></o>