Hi Help Excel

  • Thread starter Thread starter Marcelo Pregliasco
  • Start date Start date
M

Marcelo Pregliasco

I have a file *.xls when this file is open i want to desapear in the menu
"Save As" In order to the people can´t do copies.
How i can do this ?

Marcelo..Buenos Aires Argentina....
 
Marcelo

Probably can be done through VBA and I'm sure someone will provide code.

BUT........how will you prevent them making copies though Windows Explorer or
from the Command line? copy yourfile.xls myfile.xls

Gord Dibben Excel MVP
 
Hi Marcelo

To stop a "Save As" from within the *Workbook only*, use the code below.

Right click on the Excl icon, top left next to "File" and select "View
Code" in here paste

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = SaveAsUI
End Sub


Or, if you want to show the user a message, use this code.

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then
Cancel = True
MsgBox "Sorry, you cannot Save As", vbOKOnly
End If
End Sub

To get back to Excel, simply click the top right X.

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Business Software Galore!
Free Excel Forum http://www.ozgrid.com/forum ***
 
Back
Top