#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Disable save

I have a excel file that I'm trying to prevent someone from saving as or
coping data. I have disabled the "Save", "Save as..", and the copy commands.
But I notice when someone select the entire sheet (Ctrl - A) the copy command
is still available on the right click menu. How do I disable this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Disable save

Actually there are many instances of the Copy command (32) sprinkled among
the commandbars. To get them all:

Sub DisableCopyCtrl()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 19)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub

Be sure to Enable on exit as this change is saved in the user's
configuration.

But you know if the user disables macros when opening your workbook he'll be
able to copy as he pleases...

--
Jim
"Firkins" wrote in message
...
|I have a excel file that I'm trying to prevent someone from saving as or
| coping data. I have disabled the "Save", "Save as..", and the copy
commands.
| But I notice when someone select the entire sheet (Ctrl - A) the copy
command
| is still available on the right click menu. How do I disable this?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Disable save

Thanks Jim that works great.
I have my sheets very hidden with code that unhides them on open. If macros
are not enable they can't see anything.

"Jim Rech" wrote:

Actually there are many instances of the Copy command (32) sprinkled among
the commandbars. To get them all:

Sub DisableCopyCtrl()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 19)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub

Be sure to Enable on exit as this change is saved in the user's
configuration.

But you know if the user disables macros when opening your workbook he'll be
able to copy as he pleases...

--
Jim
"Firkins" wrote in message
...
|I have a excel file that I'm trying to prevent someone from saving as or
| coping data. I have disabled the "Save", "Save as..", and the copy
commands.
| But I notice when someone select the entire sheet (Ctrl - A) the copy
command
| is still available on the right click menu. How do I disable this?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Disable save

Hi Firkins

If your code also must run on Office 97 see this page for another loop
http://www.rondebruin.nl/menuid.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Firkins" wrote in message ...
Thanks Jim that works great.
I have my sheets very hidden with code that unhides them on open. If macros
are not enable they can't see anything.

"Jim Rech" wrote:

Actually there are many instances of the Copy command (32) sprinkled among
the commandbars. To get them all:

Sub DisableCopyCtrl()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 19)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub

Be sure to Enable on exit as this change is saved in the user's
configuration.

But you know if the user disables macros when opening your workbook he'll be
able to copy as he pleases...

--
Jim
"Firkins" wrote in message
...
|I have a excel file that I'm trying to prevent someone from saving as or
| coping data. I have disabled the "Save", "Save as..", and the copy
commands.
| But I notice when someone select the entire sheet (Ctrl - A) the copy
command
| is still available on the right click menu. How do I disable this?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Disable copy/paste command

Hi

I am very new to VB and have tried Jim's code below to disable the copy
command in user templates I am creating however it didn't work.

I went into VB (Alt + F11) and pasted the code into the ThisWorkbook module.
Is that correct??

Also I didn't know what Jim meant about "ensure to enable on exit".

Can someone help please??

Thanks and Merry Christmas. Silena


"Jim Rech" wrote:

Actually there are many instances of the Copy command (32) sprinkled among
the commandbars. To get them all:

Sub DisableCopyCtrl()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 19)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub

Be sure to Enable on exit as this change is saved in the user's
configuration.

But you know if the user disables macros when opening your workbook he'll be
able to copy as he pleases...

--
Jim
"Firkins" wrote in message
...
|I have a excel file that I'm trying to prevent someone from saving as or
| coping data. I have disabled the "Save", "Save as..", and the copy
commands.
| But I notice when someone select the entire sheet (Ctrl - A) the copy
command
| is still available on the right click menu. How do I disable this?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Disable copy/paste command

Hi Silena

Copy both in a normal module
http://www.rondebruin.nl/code.htm

Sub MenuControl_False()
' Excel 2000 - 2003
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=19)
Ctrl.Enabled = False
Next Ctrl
End Sub

Sub MenuControl_True()
' Excel 2000 - 2003
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=19)
Ctrl.Enabled = True
Next Ctrl
End Sub

Then in the Thisworkbook module use

Private Sub Workbook_Activate()
Call MenuControl_False
End Sub

Private Sub Workbook_Deactivate()
Call MenuControl_True
End Sub






Read also the info here
http://www.rondebruin.nl/menuid.htm

..

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Silena K-K" wrote in message ...
Hi

I am very new to VB and have tried Jim's code below to disable the copy
command in user templates I am creating however it didn't work.

I went into VB (Alt + F11) and pasted the code into the ThisWorkbook module.
Is that correct??

Also I didn't know what Jim meant about "ensure to enable on exit".

Can someone help please??

Thanks and Merry Christmas. Silena


"Jim Rech" wrote:

Actually there are many instances of the Copy command (32) sprinkled among
the commandbars. To get them all:

Sub DisableCopyCtrl()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 19)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub

Be sure to Enable on exit as this change is saved in the user's
configuration.

But you know if the user disables macros when opening your workbook he'll be
able to copy as he pleases...

--
Jim
"Firkins" wrote in message
...
|I have a excel file that I'm trying to prevent someone from saving as or
| coping data. I have disabled the "Save", "Save as..", and the copy
commands.
| But I notice when someone select the entire sheet (Ctrl - A) the copy
command
| is still available on the right click menu. How do I disable this?



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
Disable save nobbyknownowt Setting up and Configuration of Excel 1 February 14th 07 08:18 PM
Disable save nobbyknownowt[_2_] Setting up and Configuration of Excel 0 February 13th 07 03:53 PM
Save-As Option Disable Salman Excel Worksheet Functions 0 January 9th 07 12:09 PM
Disable save function JB Excel Discussion (Misc queries) 3 May 26th 05 04:06 PM
Disable "Save As" Option Andy T Excel Discussion (Misc queries) 1 December 10th 04 10:23 AM


All times are GMT +1. The time now is 10:40 AM.

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"