在Excel 2013中保存好,但在2003年忽略文件名

我有一个在Excel VBA中的代码,它保存了一个工作簿的编码path和文件名,这完全可以在我的电脑上运行Windows 8和Office 2013.当我尝试使用它在我的工作电脑上运行Windows XP和Office 2003的时候忽略编码的path和文件名,并打开默认为My Documents目录的另存为对话框。

目的是让工作的用户单击保存,文件将自动转到具有个性化文件名的networking驱动器。 他们不应该select一个path或文件名。

我一直在testingpathC:\Temp\并保存一个普通的.XLS文件,它应该可以在两个版本的Excel上工作。

我试过了,没有禁用警报,也没有给出为什么忽略path和文件名的线索。 我也试过fileformat:=xlnormal等没有运气。

为什么会发生这种情况,我该如何解决?

这里是代码:

 Sub FeedBackSave() ' Save the Feedback worksheet created by the user to the network drive using the path copied from ' the Management workhseet cell A11, the resource name copied from cell A1 and todays date as the filename. Dim wsh As Worksheet Dim nme, pth, TodaysDate As String TodaysDate = format(Now, "dd-mm-yy") nme = Range("A1").Value pth = Worksheets("Management").Range("A11").Value Application.ScreenUpdating = False Application.DisplayAlerts = False ' Prevents alerts like incorrect file type or overwrite file y/n to permit 1 click save 'Save Feedback worksheet ActiveWorkbook.Close SaveChanges:=True, Filename:=pth & "FeedBack " & nme & " " & TodaysDate & ".xls" Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub 

Saveasclosures工作簿之前,可能会有帮助。检查范围,不确定它们是否在同一张纸上。

 Sub FeedBackSave() ' Save the Feedback worksheet created by the user to the network drive using the path copied from ' the Management workhseet cell A11, the resource name copied from cell A1 and todays date as the filename. Dim wsh As Worksheet Dim nme As String, pth As String, TodaysDate As String, FName As String Set ws = Worksheets("Management") TodaysDate = Format(Now, "dd-mm-yy") nme = Range("A1").Value pth = ws.Range("A11").Value FName = pth & nme & "-" & TodaysDate & ".xls" Application.DisplayAlerts = 0 With ActiveWorkbook .SaveAs FileName:=FName .Close End With End Sub