Deactivate Save As

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am publishing a file to a local intranet. The intranet provides a read-only
function to the file. However, it does not prevent the file being saved under
the Save As function in Excel. How can I deactivate it for the intranet users
but remain active for myself?

Alex.W
 
I'd begin with a Workbook event.. using the "BeforeSave" event -- an include
a line Cancel = True also then maybe incorporate an If statement something
like.. If username = Yourname then Exit Sub (and allow the file, saveas)

Hope this helps..
 
JMay, many thanks for the reply. I am a novice at some of this. Are you able
to expand on your suggestion? What is a workbook event? What would an
appropriate macro for this look like?

Alex.W
 
From your spreadsheet do an ALT+F11 to get to the VBE program
Find your file (project) name in the Project explorere window (the tree type
window) and double-click on the THISWORKWOOK object
then in the Code window paste in:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Application.UserName <> "Jim May" Then 'as registered under Tools,
Options, General Tab, name in the box at bottom of screen
Cancel = SaveAsUI
End If
End Sub

This will prevent any user (except Jim May) from accessing the File SaveAs
option.
So change the above "Jim May" to "Your Name" as it appears EXACTLY in the
box mentioned aboe under Tools, Options, General Tab, at bottom of that
screen.

Hope this helps...

Jim May
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top