Hi,
I'm trying to create a folder on the desktop and save the activeworkbook in that folder. Since other users will use this I dont know the exact path. However I'm using this function below to tell the script where to find the path. Everything was working fine till I started to make the folder can someone point out what I may be doing wrong?
Thank You, Mike
Sub MoveMe()
Dim name As String
Dim d As String
name = ActiveWorkbook.name
d = "Production 2009"
MkDir SpecialFolderPath / d
ChDir SpecialFolderPath
ActiveWorkbook.SaveAs Filename:=speacialfolderpath & d & name
End Sub
Function SpecialFolderPath() As String
Dim objWSHShell As Object
Dim strSpecialFolderPath
'On Error GoTo ErrorHandler
' Create a shell object
Set objWSHShell = CreateObject("WScript.Shell")
' Find out the path to the passed special folder,
' just change the "Desktop" for one of the other options
SpecialFolderPath = objWSHShell.SpecialFolders("Desktop")
' Clean up
Set objWSHShell = Nothing
Exit Function
ErrorHandler:
MsgBox "Error finding " & strSpecialFolder, vbCritical + vbOKOnly, "Error"
End Function
Bookmarks