Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 01-05-2009
Member
 
Join Date: Nov 2008
Posts: 1,185
Prevent modification of values on a protected Excel file

I developed an Excel file that I protected by a password.

This file contains cells with input pull-down menus with the tool set/validation list.

The problem is that even when the file is protected, you can edit, copy and paste on these cells, and it overwrites the dropdown! How to prevent modification? Or only allow pasting Special Value?
Reply With Quote
  #2  
Old 01-05-2009
Member
 
Join Date: May 2008
Posts: 945
Re: Prevent modification of values on a protected Excel file

Code:
 Option Explicit 

  Sub DisableCopyCutAndPaste () 
  EnableControl 21, False 'cut 
  EnableControl 19, False 'copy 
  EnableControl 22, False 'paste 
  EnableControl 755, False 'pastespecial 
  Implementation. On Key "^ c", "Dummy" 
  Key Application.On "^ v", "Dummy" 
  Application.On Key "+ (DEL)", "Dummy" 
  Application.On Key "+ (INSERT)", "Dummy" 
  Application.CellDragAndDrop = False 
  Application.On DoubleClick = "Dummy" 
  CommandBars ("ToolBar List"). Enabled = False 
  End Sub 

  Sub EnableCopyCutAndPaste () 
  EnableControl 21, True 'cut 
  EnableControl 19, True 'copy 
  EnableControl 22, True 'paste 
  EnableControl 755, True 'pastespecial 
  Key Application.On "^ c" 
  Key Application.On "^ v" 
  Application.On Key "+ (DEL)" 
  Application.On Key "+ (INSERT)" 
  Application.CellDragAndDrop = True 
  Application.On DoubleClick = "" 
  CommandBars ("ToolBar List"). Enabled = True 
  End Sub 

  Sub EnableControl (Id As in protecting, Enabled As Boolean) 
  Dim CB As CommandBar 
  Dim C As CommandBarControl 

  On Error Resume Next 
  For Each CB In Application.CommandBars 
  Set C = CB.FindControl (Id: = Id, recursive: = True) 
  If Not C Is Not hing Then C. Enabled = Enabled 
  Next 

  End Sub 

  Sub Dummy () 
  '// Nogo 
  MsgBox "Sorry command not Available!" 
  End Sub
Reply With Quote
  #3  
Old 01-05-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: Prevent modification of values on a protected Excel file

Clicking on a cell, then by going to Format/cell you should see a tab "Protection", to protect it.

But it would be interesting to know first that overwrites your cells and why.

If it's malicious, but unfortunately there is no simple solution.

If it is through carelessness, then you must use cells that are located in a quiet place. For example, taking cells that are not in the first columns, or not in the first few lines, or not in the first sheet.
Reply With Quote
  #4  
Old 01-05-2009
Member
 
Join Date: Nov 2008
Posts: 1,185
Re: Prevent modification of values on a protected Excel file

But in fact, it should not be protected because it is a cell attachment!

I just want the users can not change the format by pasting or otherwise.
Reply With Quote
  #5  
Old 01-05-2009
Member
 
Join Date: May 2008
Posts: 3,971
Re: Prevent modification of values on a protected Excel file

This should help:

Code:
Private Sub Workbook_Open () 
'Ban the draw of formulas in 4 directions and the slide move 
Application.CellDragAndDrop = False 
End Sub 

Private Sub Workbook_SheetSelectionChange (ByVal Sh As Object, ByVal Target As Range) 
'Ban the collage on the same sheet as that used to copy 
Application.CutCopyMode = False 
End Sub 

Private Sub Workbook_Activate () 
'Forbidden bonding after a copy from another workbook 
Application.CutCopyMode = False 
End Sub 

Private Sub Workbook_SheetActivate () 
'Forbidden bonding after a copy from another sheet same workbook 
Application.CutCopyMode = False 
End Sub 

Private Sub Workbook_BeforeClose (Cancel As Boolean) 
'Active drawing of formulas in 4 directions and 
'the technique of drag and drop to the cells. 
Application.CellDragAndDrop = True 

'Active possible bonding 
Application.CutCopyMode = True 
End Sub
Reply With Quote
  #6  
Old 02-05-2009
Janupagla
 
Posts: n/a
Re: Prevent modification of values on a protected Excel file

This activity has been password protected to prevent modification. In order to request an ... these values. Compare your values with your group members. .... Plot the following data using Excel and determine the highest .
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Prevent modification of values on a protected Excel file"
Thread Thread Starter Forum Replies Last Post
How to unlock password protected ms excel file ? Foy Windows Software 9 24-04-2013 01:26 PM
How to calculate values in different spreadsheets of Excel Shard.K MS Office Support 2 23-02-2012 07:18 PM
How to get a file last modification date in java? MAGAR Software Development 4 04-02-2010 09:34 PM
Excel : vlookup multiple values Laler Windows Software 3 25-06-2009 10:27 AM
Monitor folder for file modification, creation or deletion using WMI Highlander Windows Server Help 5 27-01-2009 07:45 PM


All times are GMT +5.5. The time now is 04:03 PM.