Results 1 to 6 of 6

Thread: Prevent modification of values on a protected Excel file

  1. #1
    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?

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

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

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

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

  6. #6
    Janupagla Guest

    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 .

Similar Threads

  1. How to unlock password protected ms excel file ?
    By Foy in forum Windows Software
    Replies: 9
    Last Post: 24-04-2013, 01:26 PM
  2. How to calculate values in different spreadsheets of Excel
    By Shard.K in forum MS Office Support
    Replies: 2
    Last Post: 23-02-2012, 07:18 PM
  3. How to get a file last modification date in java?
    By MAGAR in forum Software Development
    Replies: 4
    Last Post: 04-02-2010, 09:34 PM
  4. Excel : vlookup multiple values
    By Laler in forum Windows Software
    Replies: 3
    Last Post: 25-06-2009, 10:27 AM
  5. Replies: 5
    Last Post: 27-01-2009, 07:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,961,547.60729 seconds with 17 queries