Disallow "SAVE" only "SAVE AS" or prompt
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Application.EnableEvents = False
Cancel = True
ThisWorkbook.SaveAs Worksheets("Sheet1").Range("J2").Value
Application.EnableEvents = True
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"DTTODGG" wrote in message
...
OK - I want to be a bit fancier now.
I have a template. I would like to force the file to be saved by the name
it
a cell (J2). So, when they want to save the file, they just click on save
or
save as, the template prompts them for a name, the name is already filled
in
as the name in cell J2, they just confirm it.
Thank you for teaching me a lot and making me look good!
"DTTODGG" wrote:
Hello-
I have built a form using excel. I have protected all cells except user
inputs.
I'm wondering if there is a way to force the user to either exit without
saving or use "save as". I guess that sort a makes this file a template.
Either way, I would appreciate your wisdom on how to solve this dilema.
I have only poked around with macros and vba so be very specific.
Thank you kindly
|