+ Reply to Thread
Results 1 to 5 of 5

Protected Sheet not protected from Copy Paste

  1. #1
    Registered User
    Join Date
    04-14-2010
    Location
    NH
    MS-Off Ver
    Excel 2003
    Posts
    2

    Protected Sheet not protected from Copy Paste

    I'm writing an import task in SQL Server that grabs data from an excel spread sheet created by one of my users (Access 2003).

    SQL Server is quite picky about formatting, column names, and sheet name and since my users were having problems not changing these elements of the work sheet I created a password protected sheet that locks the column headers and formatting.

    on the list of unprotected elements only the first two boxes are ticked.

    When the user types things in manually this works fine. however if they copy data from another excel file that has custom formatting on the cells and paste it into my protected sheet it ignores the protection and changes the formatting for those cells!

    This can't possible be the designed functionality of a protected sheet, is there any way to force the sheet to retain it's formatting and ignore the formatting of pasted content?

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Protected Sheet not protected from Copy Paste

    Hi Twisted, welcome to the forum.

    When you protected the sheet, were the cells you want protected Locked? Check that, as I can't paste into a protected cell or range of cells whether I copy cells from the same workbook/sheet or a different one (seperate Excel.exe running).

    Right-click on the affected cells and choose Format Cells. Look at the Protection tab and make sure 'Locked' is checked.

  3. #3
    Registered User
    Join Date
    04-14-2010
    Location
    NH
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Protected Sheet not protected from Copy Paste

    the only fields that are locked are the title row.

    the remainder of the cells are not locked.

    I want the user to be able to enter data into the cells below the title row, but NOT modify the formatting.

    as I said this works for users entering text manually (the are also unable to change the formatting though any of excels menus) but it does not work when pasted from another spread sheet.

    I've attached the file so you can see for yourself.

    all of the fields are set to be formatted in plain text and it cannot be changed,

    however, if you copy and paste a formatted cell from another sheet it will overwrite the formatting on the protected sheet.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Protected Sheet not protected from Copy Paste

    It's not so easy. :/ Here's a thread where I asked the same question with some solutions.
    http://www.excelforum.com/excel-prog...aste-code.html
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Protected Sheet not protected from Copy Paste

    I opened your sample workbook, then opened a second workbook with some text and formatting. Upon copying cells from the second workbook and pasting into the first (yours) I can paste the information into any of the unlocked cells, but not into the locked (row 1) cells. I get the "The cell or chart ... is protected.." message when trying to do that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1