473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Protected Excel Sheet acting up when Pasting multiple rows

TheSmileyCoder
2,322 Expert Mod 2GB
This is one of those questions I fear will never be answered, but I have to give it a go.

I use an excel spreadsheet (built from Access) to export our review Comments. All of the columns are locked, bar one, in which our contractor is expected to put in his/her replies to our comments. Now sometimes they answer in word instead.

So I went to word, copied the relevant column and went into the excel file to paste their replies in. (Because I have a function in Access that imports their answers from the excel sheet).

Now for some reason the X rows in the word file becomes X+Y rows in the excel file. I presume it has something to do with linebreaks. That is not really my question, I simply list it for reference.

However, after pasting this into the unlocked column, it seems that it suddenly becomes locked. My own guesses are that it could be due to ranges being displaced, but to be honest im quite at a loss, as excel is not really my thing. Any idea why it becomes locked? And how to prevent it!
Feb 8 '12 #1
9 3169
Mariostg
332 100+
Hi Smiley.
Do you Edit->Paste Special -> As text, to make sure no word format is brought it?
Feb 8 '12 #2
TheSmileyCoder
2,322 Expert Mod 2GB
Hi Mario

thank you for your suggestion. I have tried that. It does solve the Protected problem, but the paste output is still several rows longer then the word input.

I would hope to find the root cause of this, hopefully such that the end user can do the paste himself without needing special instructions. The end user is not all that tech savy.
Feb 8 '12 #3
NeoPa
32,556 Expert Mod 16PB
Smiley:
This is one of those questions I fear will never be answered, but I have to give it a go.
Oh ye of little faith!

As Mario says, Pasting-Special Unformatted Text should resolve that for you. Protecting of cells in Excel is a two-level process.
  1. Each cell has a property that specifies whether or not that item is considered locked or otherwise.
  2. Worksheets, though, have a Protection setting which determines whether that property should even be considered.

Assuming that the worksheets are all protected (otherwise no locking would work at all), the column you're pasting into must be made up exclusively of cells which are unlocked. Fine so far.

Now, when you paste data in using the standard Paste process, you are pasting over the existing cells. Not just their values (as would be the case with Paste-Special). So, either a cell in a Word table also has a property which is matched on pasting with the Excel cell's Locked property - and thus replaces/overwrites it, or not, and the default for the worksheet is used (which typically means new cells are treated as Locked). What never happens is that the original setting is kept as is, as the whole cell has been replaced - not just the value. This is actually quite a common problem and, AFAIA, has not yet been resolved by a protection option that allows protection of the Locked property itself. A straightforward and, pretty obvious, solution TBF. The default for the worksheet can be changed, but pasting just the values will also work fine to ensure the original property values are maintained.

To break down the extra cells problem I would need to have access to the exact details more closely. If you want to send me an example I'll happily look into it for you. Otherwise we can talk about it on Skype. I'm pretty confident that it somehow comes down to how much the operator selects when they do the copying though. That's fairly clear in Excel, but can be less obvious in a Word Table.
Feb 8 '12 #4
TheSmileyCoder
2,322 Expert Mod 2GB
So, back from holiday.

The main issue here is the mucking up of the locked property, since I can imagine it causes alot of confusion. If you can suggest a way to avoid that (by perhaps elaborating on how to change the default for the locked property) it would be very nice.

I will try to get a sample created which doesn't contain sensitive data to upload.
Feb 20 '12 #5
NeoPa
32,556 Expert Mod 16PB
Unlocked cells allow pasting of cells from the clipboard Smiley. If those cells are themselves locked, and the worksheet itself is protected, then you no longer have unlocked cells. That's the problem in a nutshell. If you want to avoid the problem (unless and until MS fix the obvious flaw in their logic) then you'll need to disable pasting into those cells entirely and somehow manage handle transferring data only after testing it for validity. Not remotely trivial.
Feb 20 '12 #6
TheSmileyCoder
2,322 Expert Mod 2GB
The cells being pasted from are not locked.

Could there be a way to set the default paste method for a worksheet to be text only?
Feb 20 '12 #7
NeoPa
32,556 Expert Mod 16PB
Smiley:
The cells being pasted from are not locked.
Do you mean that? Or are you saying the sheet they were copied from is not protected? I explained the difference in detail in post #4. If they're really not locked then you shouldn't see any problem ;-)

Smiley:
Could there be a way to set the default paste method for a worksheet to be text only?
No. That would be too easy. There is no easy way around this that I've ever found, and I've looked. I found a way round for my needs, but it wasn't easy, and had more kludginess to it than I would have liked.
Feb 20 '12 #8
TheSmileyCoder
2,322 Expert Mod 2GB
Pasting just the values does not trigger the cells becoming locked. As far as I am able to see the word table is not locked. I even tried creating a fresh word table, with a few rows in a fresh table and pasted from there.

The excel sheets (in their protected state with columns A through G locked, and H unlocked) gets distributed to the contractor (who ships some of to sub-contractors). I imagine they write their replies in another program, probably word, and when they paste the values into the excel sheet they complain of it being locked.
Now these excel sheets may go off to as many as 10 different companies and be handled by maybe 100 different people. So I would really like something that works, without having to give the receivers(s) special instructions, since I know they wont read them anyway.
Feb 20 '12 #9
NeoPa
32,556 Expert Mod 16PB
Smiley:
So I would really like something that works, without having to give the receivers(s) special instructions, since I know they wont read them anyway.
Of course you would my friend (and so would many of us). Unfortunately ... (See earlier replies - particularly post #4).
Feb 21 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
5
by: HDI | last post by:
Hi, How can I programmatically open a password protected excel-sheet? Thx
0
by: MalingreM | last post by:
Hi, I'm quite new to sql2005, and I've the following problem. When I insert records in table Data one by one, the insert/update trigger fires correctly, but: when i insert multiple records at once;...
1
ammoos
by: ammoos | last post by:
Hi friends Actually my problem is with the excel sheets. I have convert one of my access report to excel sheet that have too many records. After I convert the report to excel successfully, I cant...
14
by: veer | last post by:
can any one help by providing the method inserting the records in excel file because i created it all it works fine but i have no idea about how to insert new records in the existing excel file....
1
by: progvar | last post by:
Hi! CAN I USE THE FOLLOWING CODE FOR TRANSFERING THE DATA FROM ONE TABLE INTO ANOTHER AND THEN INTO EXCEL SHEET BUT WHEN I RUN THE PROGRAME IT PRODUCES THE ERROR "OPERATION IS NOT ALLOWED WHEN THE...
4
ammoos
by: ammoos | last post by:
Hi Friends, I need to read data from an excel sheet. I am keeping this excel sheet in a remote machine. I am using OLEDB connection to read the data from this excel sheet. But when I am trying to...
3
anoble1
by: anoble1 | last post by:
Hopefully I can explain this. I have a main excel sheet that when it opens it grabs data from 8 other spread sheets and updates numbers on the main one. Well, when it opens in Excel 2007 I get a...
1
kirubagari
by: kirubagari | last post by:
Hai experts, How to duplicate the data from 1 excel sheet to another excel sheet 2. Lets say Name Voucher Value Voucher Number lee 300.00 ...
13
by: santhanalakshmi | last post by:
Hi, I am working on SQL 2008 database. In Micosoft SQL server Management studio, i am trying to insert multiple records at a time in a table, using this query insert into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.