ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Deactivate Save As (https://www.excelbanter.com/excel-discussion-misc-queries/147144-deactivate-save.html)

Alex.W

Deactivate Save As
 
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

JMay

Deactivate Save As
 
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..


"Alex.W" wrote:

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


Alex.W

Deactivate Save As
 
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

"JMay" wrote:

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..


"Alex.W" wrote:

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


JMay

Deactivate Save As
 
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

"Alex.W" wrote:

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

"JMay" wrote:

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..


"Alex.W" wrote:

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


Alex.W

Deactivate Save As
 
Jim
You are a gentleman of the highest order. It works. Thanks very much.
Alex.W

"JMay" wrote:

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

"Alex.W" wrote:

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

"JMay" wrote:

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..


"Alex.W" wrote:

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


JMay

Deactivate Save As
 
Glad it works for you. Thanks for the feedback (and complement :-)).
JMay

"Alex.W" wrote:

Jim
You are a gentleman of the highest order. It works. Thanks very much.
Alex.W

"JMay" wrote:

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

"Alex.W" wrote:

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

"JMay" wrote:

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..


"Alex.W" wrote:

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



All times are GMT +1. The time now is 12:56 PM.

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