Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA - Protecting from Save

Is there a code to write that will allow users of the file
to only SAVE AS, and not SAVE? Please help, I'm having
trouble preventing people from using SAVE on template
forms I built, and therefore their info. is there every
time I open the files. Thank you very much!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default VBA - Protecting from Save

In the ThisWorkbook Class Module:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

If SaveAsUI = False Then Cancel = True

End Sub

Regards

Trevor


"HRobertson" wrote in message
...
Is there a code to write that will allow users of the file
to only SAVE AS, and not SAVE? Please help, I'm having
trouble preventing people from using SAVE on template
forms I built, and therefore their info. is there every
time I open the files. Thank you very much!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA - Protecting from Save

Put in a workbook_Open event that prompts for a file name and saves the
file.

Private Sub Workbook_Open()
Dim fname as String
if ThisWorkbook.Name = "TemplateName.xls" then
fname = application.GetSaveAsFilename()
if fname = "false" then fname = "TemplateName" &
format(date,"yyyymmdd_hhmm") _
& ".xls"
Thisworkbook.SaveAs fname
End if
End Sub

--
Regards,
Tom Ogilvy


"HRobertson" wrote in message
...
Is there a code to write that will allow users of the file
to only SAVE AS, and not SAVE? Please help, I'm having
trouble preventing people from using SAVE on template
forms I built, and therefore their info. is there every
time I open the files. Thank you very much!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA - Protecting from Save

Another approach would be mark the template as Read-Only using Windows
explorer, right clicking on the file and selecting options.

--
Regards,
Tom Ogilvy

"HRobertson" wrote in message
...
Is there a code to write that will allow users of the file
to only SAVE AS, and not SAVE? Please help, I'm having
trouble preventing people from using SAVE on template
forms I built, and therefore their info. is there every
time I open the files. Thank you very much!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
protecting formulas without protecting sheet so grouping still wor JM Excel Discussion (Misc queries) 1 June 4th 09 06:42 AM
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
SAVE and SAVE AS options disappeared from the drop down FILE menu [email protected] Excel Discussion (Misc queries) 2 July 12th 07 09:14 AM
Save As and save current numbers not the actual formulas and links Frank Menard Excel Discussion (Misc queries) 2 November 9th 06 09:18 PM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM


All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"