ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Disallow "SAVE" only "SAVE AS" or prompt (https://www.excelbanter.com/setting-up-configuration-excel/60174-disallow-save-only-save-prompt.html)

DTTODGG

Disallow "SAVE" only "SAVE AS" or prompt
 
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

DTTODGG

Disallow "SAVE" only "SAVE AS" or prompt
 
OK, so a template does work!
Sorry to waste bit bucket space.

So many questions, so little time!

"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


DTTODGG

Disallow "SAVE" only "SAVE AS" or prompt
 
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


Bob Phillips

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




DTTODGG

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





Marc

Disallow "SAVE" only "SAVE AS" or prompt
 
Well, why don't you just make the file read only? Then the only way to save
is "save as"...



DTTODGG

Disallow "SAVE" only "SAVE AS" or prompt
 
Thank you, Marc -

But, as long as I already have a macro running, could someone tell me how to
disallow SAVE AS, this way, I know I will end up with the proper naming
conventions.

Also, could someone read the post above about specifying directories to SAVE
in?

I really appreciate all the help on this site!
Thanks again!

"Marc" wrote:

Well, why don't you just make the file read only? Then the only way to save
is "save as"...





All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com