H
Hari
Hi,
Can one disable "Save as" option in the file menu.
I have a file which will be filled with data and mailed back to me.
I want that the users save the file with a specific name only.
Im using a Macro to save a file where today's date is attached along
with the normal file name.
But I notice that this works only if the user presses save on the
file menu.
If they use Save as option then the user ends up saving file once in
my format and then s/he is prompted with a save as dialogue where s/he may
save it with a different name also.
Please tell me if there is a way one may overcome this.
Here is my present code which is pasted in "This workbook".
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
' Here I have code to check for data internal data consistency. The file
will not save if there is any problem.
If soandso = suchandsuch Then
Cancel = true
End if
ActiveWorkbook.SaveAs Filename:="C:\Hari " & Format(Now, "yyyy-mm-dd"),
FileFormat:=xlNormal
End Sub
Regards,
Hari
India
Can one disable "Save as" option in the file menu.
I have a file which will be filled with data and mailed back to me.
I want that the users save the file with a specific name only.
Im using a Macro to save a file where today's date is attached along
with the normal file name.
But I notice that this works only if the user presses save on the
file menu.
If they use Save as option then the user ends up saving file once in
my format and then s/he is prompted with a save as dialogue where s/he may
save it with a different name also.
Please tell me if there is a way one may overcome this.
Here is my present code which is pasted in "This workbook".
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
' Here I have code to check for data internal data consistency. The file
will not save if there is any problem.
If soandso = suchandsuch Then
Cancel = true
End if
ActiveWorkbook.SaveAs Filename:="C:\Hari " & Format(Now, "yyyy-mm-dd"),
FileFormat:=xlNormal
End Sub
Regards,
Hari
India