can we prevent user using the "save as" function in excel 97..but they still can use the "save" func


Posted by newby on October 04, 2000 2:40 AM

regard

Posted by David on October 04, 2000 2:57 AM

Sub disabl()
This won't save all your problems but...

Application.CommandBars("File").Controls.Item("Save As...").Enabled = False
End Sub

Sub enabl()
Application.CommandBars("File").Controls.Item("Save As...").Enabled = True
End Sub

Posted by Ivan Moala on October 04, 2000 4:20 AM


You should also add;
CommandBars("ToolBar List").Enabled = False

To disable the selection of the Save as icon
available via Right click / Tools / customize.

AND also
commandbars("Tools").controls.item("Customize...").enabled = false

Ivan

Posted by newby on October 04, 2000 8:14 AM

thanks david n ivan..but could u guys elaborately the easy way..n where will i have to paste this code?thanks again..

Posted by Ivan Moala on October 06, 2000 4:32 AM

Re: thanks david n ivan..but could u guys elaborately the easy way..n where will i have to paste this code?thanks again..

Newby

Place this code under the Thisworkbook excel module

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Enable_SaveAs
End Sub

Private Sub Workbook_Open()
Disable_SaveAs
End Sub


and then this code in a Module;

Sub Enable_SaveAs()
CommandBars("File").Controls.Item("Save As...").Enabled = True

'Disable Right click option on Toolbars
CommandBars("ToolBar List").Enabled = True

'To disable the selection of the Save as icon
'available via Right click / Tools / customize.
CommandBars("Tools").Controls.Item("Customize...").Enabled = True

End Sub

Sub Disable_SaveAs()

CommandBars("File").Controls.Item("Save As...").Enabled = False

'Disable Right click option on Toolbars
CommandBars("ToolBar List").Enabled = False

'To disable the selection of the Save as icon
'available via Right click / Tools / customize.
CommandBars("Tools").Controls.Item("Customize...").Enabled = False


End Sub


Ivan



Posted by newby on October 08, 2000 6:27 AM

thanks Ivan..u r the great ....n helpful.regards

Place this code under the Thisworkbook excel module Private Sub Workbook_BeforeClose(Cancel As Boolean)