Hi Guys,
Having problems so late in the afternoon...
I have a piece of code that is suppose to defualt to the file's current directory if not specified but for some reason this does not work...
Am I refering to ismissing() incorrect or what?
Sub pass()
Dim thename As String: thename = "myWorkbook"
Dim thetype As String: thetype = "xltm"
Dim direct As String: direct = "C:\"
Call mod_SaveAs(thename, thetype)
End Sub
Function mod_SaveAs(file_Name As String, fileType As String, Optional newDir As String)
Dim completeName As String, file_ext As String
If IsMissing(newDir) Then
newDir = ActiveWorkbook.Path 'whatsMyDir
End If
completeName = newDir & "/" & file_Name & "." & fileType
MsgBox newDir
MsgBox file_Name
MsgBox fileType
MsgBox completeName
MsgBox "Save complete"
End Function
Bookmarks