Disallow "SAVE" only "SAVE AS" or prompt
Bob, Thank you so much!
Can you help me specify the directory to save this file in?
In addition, if I save in "C:/MyForms/Range"J2".xls" what happens if the
directory doesn't exist? Will it prompt to make a directory?
Cheers!
P.S. I picked up O'Reilly's book on macros - so maybe there's hope I'll
learn this stuff. A lot of my problems are syntax - how to you name an
external file you want to open, how you specify cells in other workbooks or
worksheets. But I'm learning.
"Bob Phillips" wrote:
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
|