C
chemicals
This code did work before.... All I am trying to do is a SaveAs to another
directory.
I am using Office 2003....
I get no errors but the SaveAs function doesn't rename the current workbook
that is open nor does it savea copy to the forlder specified...what gives?
Here is my code:
Sub SaveAsFile()
Dim strDocName As String
Const FilePath As String = "H:\Client\"
On Error GoTo err_handler
ChDrive FilePath
ChDir FilePath
strDocName = Application.GetSaveAsFilename(filefilter:="*.xls, *.xls")
If strDocName <> "False" Then
'do not allow it to be stored in the local directory
If (Left(strDocName, 33) = "H:\Client\Deliverables Schedules") Then
MsgBox "This schedule must be saved to the appropriate folder on
H:\Client!", vbCritical, "Wrong Folder"
Cancel = True
Else
ActiveWorkbook.SaveAs strDocName
End If
End If
Exit Sub
err_handler:
MsgBox Err.Number & " " & Err.Description
End Sub
directory.
I am using Office 2003....
I get no errors but the SaveAs function doesn't rename the current workbook
that is open nor does it savea copy to the forlder specified...what gives?
Here is my code:
Sub SaveAsFile()
Dim strDocName As String
Const FilePath As String = "H:\Client\"
On Error GoTo err_handler
ChDrive FilePath
ChDir FilePath
strDocName = Application.GetSaveAsFilename(filefilter:="*.xls, *.xls")
If strDocName <> "False" Then
'do not allow it to be stored in the local directory
If (Left(strDocName, 33) = "H:\Client\Deliverables Schedules") Then
MsgBox "This schedule must be saved to the appropriate folder on
H:\Client!", vbCritical, "Wrong Folder"
Cancel = True
Else
ActiveWorkbook.SaveAs strDocName
End If
End If
Exit Sub
err_handler:
MsgBox Err.Number & " " & Err.Description
End Sub