Sub 另存()
If [C16] = "" Then
MsgBox "请输入工程名"
Else
Path = "D:\"
ActiveWorkbook.SaveAs Filename:=Path & [C16].Value
ActiveWindow.Close
End If
End Sub
代码指定另存目录为D盘根目录
弹出另存对话框的话,
Sub 另存()
temp = [c16].Value
If temp = "" Then
MsgBox "请输入工程名"
Else
Path = "D:\"
filesavename = Application.GetSaveAsFilename(temp)
If filesavename <> False Then
ActiveWorkbook.SaveAs Filename:=filesavename & "xls"
End If
ActiveWindow.Close
End If
End Sub