Thank you very much Kelshaer for your reply. This problem was solved.
Now I get another problem saving.
The file can be saved fine but the message won't show after saving:
Sub SAVE_XLS_FORMAT()
'Working in Excel 97-2010
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim TempFilePath As String
Dim TempFileName As String
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set Sourcewb = ActiveWorkbook
Set Destwb = ActiveWorkbook
'Determine the Excel version and file extension/format
With Destwb
If Val(Application.Version) < 12 Then
'You use Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
Else
'You use Excel 2007-2010
FileExtStr = ".xls": FileFormatNum = 56
'Disable compatibility check
Destwb.CheckCompatibility = False
End If
End With
'Run Template Wizard Add-in to write record upon saving
Application.Run "wztemplt.xla!commit"
'Save the new workbook and close it
TempFilePath = "\\usershare\2012 XLS\"
TempFileName = Format(Range("E17"), "000") & "_" & Replace(Range("B19"), " ", "_")
With Destwb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
.Close SaveChanges:=False
End With
MsgBox TempFileName & " has been saved in '2012 XLS' folder"
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Again I don't know what the problem is.
Could you please help me with this also?
Bookmarks