New issue
Advanced search Search tips

Issue 28636 link

Starred by 25 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Compat



Sign in to add a comment

Extra space appended after pasting a value when it ends in a newline

Reported by 2michae...@gmail.com, Nov 23 2009

Issue description

Chrome Version       : 3.0.195.33
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 4:
Firefox 3.x:
         IE 7: OK
         IE 8: OK

What steps will reproduce the problem?
1. copy a value in a cell from Excel
2. paste into a text box (user name, password etc), Chrome always adds a 
space at the end of whatever I paste
3. doesn't happen if I paste into IE text box

What is the expected result?
value pasted should be the same as value copied.


What happens instead?
value pasted get an extra space after the value copied.

Please provide any additional information below. Attach a screenshot if
possible.

 
This is still an issue on the current stable builds and the 5.0.375.29 beta build I'm 
running now.  Copying the data from within the cell gets pasted fine into Chrome 
however copying the actual cell itself always leads to a trailing space.
I have the same problem. For what it's worth, Firefox exhibits the same issue unless
Editor.singleLine.pasteNewlines = 5

It appears to be due to a newline embedded in the string.
http://kb.mozillazine.org/Editor.singleLine.pasteNewlines 

Very frustrating - hopefully Chrome can adopt a similar approach.
adding comment so I get notified of any updates to this (which duplicates my issue 
36253)
I've been using this kludge as a workaround.. It's a macro that deletes the newline characters from the clipboard. I set this up to be activated by control-c - thus replacing the default copy. I also added a drop down item in the edit menu.  A bit ugly, but it seems to work.

Sub copy_text()
' copies cell text to clipboard without ending newline
    Dim DataObj As New MSForms.DataObject
    Dim S As String
    Dim S_len As Integer

    nl = Chr(10)
    cr = Chr(13)
    
    Selection.Copy
    DataObj.GetFromClipboard
    S = DataObj.GetText
    S = Replace(S, nl, "")
    S = Replace(S, cr, "")
    DataObj.SetText S
    DataObj.PutInClipboard
End Sub

Comment 5 by mystic...@gmail.com, Aug 23 2010

Any way to change chrome's behavior for newline characters in a single-line text box?
Configuration files or something ?

Comment 6 by peter@chromium.org, Mar 3 2011

 Issue 36253  has been merged into this issue.

Comment 7 by peter@chromium.org, Mar 3 2011

 Issue 74787  has been merged into this issue.

Comment 8 by peter@chromium.org, Mar 3 2011

Labels: -Area-Misc Area-Compat-Web Area-WebKit WebKit-Core
Status: Untriaged
Summary: Extra space appended after pasting a value when it ends in a newline
Microsoft Office Excel 2007 adds CR LF after the contents of a copied cell, therefore this same effects occurs when copying to other programs as well. This issue is more about trimming new-line suffixes (and perhaps prefixes) than it is about an Excel issue.

Opera appends two spaces in both the address-bar as input fields. Safari adds one space in both, Chrome adds no spaces in the address-bar, but one in input fields. Firefox and Internet Explorer trim all spaces upon pasting on both locations.

Comment 9 by copu...@gmail.com, Mar 5 2011

Firefox and IE dont have this bug :)

Comment 10 by Deleted ...@, Mar 23 2011

so the one space on input fields, is this being removed?
Labels: -Area-Compat-Web bulkmove Area-Compat
Labels: Mstone-X

Comment 13 by kareng@google.com, May 13 2011

Status: Available

Comment 14 by Deleted ...@, May 24 2011

Copying a password from Excel 2000 to:

Chrome 11.0.696.68 ... It adds a space at the end of the cell in the web page
IE 8.0.6001.18702 .... It doesn't do this

The Cell View add-in does not show any extra space in the cell
http://www.cpearson.com/excel/CellView.aspx

Comment 15 by Deleted ...@, Feb 9 2012

Can anyone please help? Why when I run this macros do I get this error:
"User-defined type not defined" ?

Sub copy_text()
' copies cell text to clipboard without ending newline
    Dim DataObj As New MSForms.DataObject
    Dim S As String
    Dim S_len As Integer

    nl = Chr(10)
    cr = Chr(13)
    
    Selection.Copy
    DataObj.GetFromClipboard
    S = DataObj.GetText
    S = Replace(S, nl, "")
    S = Replace(S, cr, "")
    DataObj.SetText S
    DataObj.PutInClipboard
End Sub
I suspect that one of the object libraries is not properly referenced.
Edit the macro and from the Visual Basic window, go to Tools | References.
I am using Excel 2003. On my copy, the first four Available references are checked:
VB for applications, Excel 11.0 Object Library, OLE Automation, and Office 11.0 Object Library.

Try checking these and see if that helps.

Comment 17 by Deleted ...@, Feb 15 2012

Craig, your help is very much appreciated, thanks for directing me to Tools | References, the first 4 references were checked, however MS forms 2.0. Object library was unchecked - I checked it and the error disappeared.

After that I started receiving another error:
run-time error '-2147221040 (800401d0)'
DataObject:GetfromClipboard OpenClipboard Failed

But after installing latest windows updates this has been resolved.

Your script works perfectly. I have been looking for this for maybe 5 years before you posted it here. Thanks a lot.

Comment 18 by Deleted ...@, Feb 15 2012

2/15/12 using the latest version of Chrome 17.0.963.46 m ... and Excel 2000 9.0.8968 SP-3

It not only adds a space now, but . . .

UserID:  it adds a space and a return
Password:  it adds three extra dots
URL:  it adds no spaces when putting in a URL

***************************************

This doesn't happen in the latest version of Internet Explorer 8.0.6001.18702
or in the latest version of Firefox 10.0.1

. . . so it looks like an issue with Chrome . . .

***************************************

If I go to the following in Excel 2000:

Tools / Macro / Visual Basic Editor

and then:

Tools / References / . . . 5 were checked

1) Visual Basic For Applications
2) Microsoft Excel 9.0 Object Library
3) OLE Automation
4) Microsoft Forms 2.0 Object Library
5) Microsoft Office 9.0 Object Library

I thought maybe if I un-check all of these, close Excel and Chrome, re-open, and re-check all of these, that will fix it . . .
. . . it only let me un-check #3 and #5 . . . for the others, it said, "Can't remove control or reference; in use"

With these two un-checked, I get the same thing:

UserID:  it adds a space and a return
Password:  it adds three extra dots
URL:  it adds no spaces when putting in a URL

***************************************

If I go back to Excel to the References . . .
it still won't let me un-check those three, same reason, so
I will now try to re-check #3 and #5:

3) OLE Automation - done
5) Microsoft Office 9.0 Object Library - it's no longer there! . . . instead, what's there is
Microsoft Office 12.0 Object Library, so I checked it

I close and re-open Chrome and Excel, and I get the same thing:

UserID:  it adds a space and a return
Password:  it adds three extra dots
URL:  it adds no spaces when putting in a URL

***************************************
***************************************

This leads me to think the issue lies here (since you have version 11 and it works):

2) Microsoft Excel 9.0 Object Library . . . Location:  C:\Program Files\Microsoft Office\Office\EXCEL9.OLB

Can I use the Microsoft Excel 11.0 Object Library in Excel 2000?

- - - - - - - - - - - - - - - - - - - -

Aside . . . while in that area, I tried checking the "OLE DB Errors Type Library" that looked related - it changes its name to "Microsoft OLE DB Error Library" - but it had no effect, same thing

- - - - - - - - - - - - - - - - - - - -

There are a lot of other things to check in there though, so it seems like something should be able to fix it, for example:

Visual Basic For Applications (the one that was checked originally) is here:
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VB ... cut off, one of them in here

Additional "Visual Basic For Applications" not checked below:
C:\WINDOWS\system32\VEN2232.OLB
C:\WINDOWS\system32\VBAEND32.OLB
C:\WINDOWS\system32\VBAEN32.OLB
C:\WINDOWS\system32\Msvbvm60.dll

but then I would have to register each of these, and try them through the process of elimination?

***************************************
***************************************

From these two pages, I don't think I can use the Microsoft Excel 11.0 Object Library in Excel 2000

- - - - - - - - - - - - - - - - - - - -

http://www.vbforums.com/showthread.php?t=225058

register it usind regsvr32.exe

if if still doesnt show up, use the browse button when createing the reference to browse to the olb

This definitly works, cause I am doing this on my machine.

- - - - - - - - - - - - - - - - - - - -

http://social.msdn.microsoft.com/Forums/en-US/vcmfcatl/thread/477fc075-0a0a-4f69-b662-a8996b5d509f/

http://support.microsoft.com/kb/178749 

If you are automating Microsoft Excel 2000, choose Microsoft Excel 9.0 Object Library for which the default location is the C:\Program Files\Microsoft Office\Office\Excel9.olb. 

If you are automating Microsoft Excel 2002 and Microsoft Office Excel 2003, the object library is embedded in the file Excel.exe .

***************************************

Comment 19 by Deleted ...@, Feb 15 2012

2/15/12 using the latest version of Chrome 17.0.963.46 m ... and Excel 2000 9.0.8968 SP-3

The Discover Card web site login behaves differently than the YouTube login.

I paste in the User ID ... I then have to click to another cell to see it ... there is one space after the User ID, it then goes up 1/2 of a row height higher than normal.

I paste in the password ... the dots show up, and there are two extra dots at the end that I have to erase ... it is *not* 1/2 of a row height higher up, it's normal.



I'm having the same issue as slack7.  I'm using Excel 2007.

Comment 21 by Deleted ...@, Feb 18 2012

It must not be my Microsoft Excel 9.0 Object Library then, and some issue with Chrome.

There are lots of posts on this, check out these keywords:
google chrome adds spaces from excel when pasting

This looks like the best workaround:
"It only happens when you select the cell and copy, not when you select the text inside the cell"
http://code.google.com/p/chromium/issues/detail?id=110183

Comment 22 by kfair...@gmail.com, Feb 21 2012

Seems like there should be a setting in Excel where you could set what the clipboard captures.  So instead of capturing Rich Text, it would capture Plain Text.  Anyone know how to do that?

Comment 23 by Deleted ...@, Feb 21 2012

It's something to do with Chrome and not Excel, cause it doesn't happen in Firefox or IE8

Comment 24 by kfair...@gmail.com, Feb 21 2012

vdesgn...I found this on how to add 'Microsoft Forms 2.0 Object Library'

http://p2p.wrox.com/excel-vba/5118-how-get-microsoft-forms-2-0-object-library.html

Comment 25 by kfair...@gmail.com, Feb 21 2012

slack7, definitely an issue with Chrome.  I was adding the Macro and didn't have Microsoft Forms added.  The kluge is working for me too!

Thanks to Craig for the Macro!

Comment 26 by Deleted ...@, Feb 29 2012

This seems related - I notice this in Notepad with XP:

Why does Windows Vista's Notepad randomly move the cursor after saving a file?
http://superuser.com/questions/57190/why-does-windows-vistas-notepad-randomly-move-the-cursor-after-saving-a-file

Notepad bug: Saving with word wrap on inserts CR CR LF characters in the display window
http://bavih.blogspot.com/2008/07/notepad-bug.html

If you turn off Word Wrap in Notepad, then it doesn't add the CR CR LF, and the cursor doesn't jump.

In Excel, I see that Alignment / Wrap text was not selected . . . so I'm still stumped, but I think the answer must be along this line of thinking

Comment 27 by Deleted ...@, Mar 8 2012

As of 3/8/12, this issue is still in Chrome 17.0.963.78.  I remember that Firefox once had the same issue but they fixed it a year or two ago during one of the updates.

Comment 28 by Deleted ...@, Mar 9 2012

In Excel 2000, if you go to the Help file and read about the "clipboard" . . . (interesting info is below), 

1) There is a Clipboard toolbar
2) The Office Clipboard can hold up to 12 items
3) Maybe it's related to OLE? (". . . copying the information from a program that does not support OLE) - but text isn't an object

************************************

View the contents of the Office Clipboard - On the View menu, point to Toolbars, and then click the Clipboard toolbar . . . To view the first 50 text characters in an item, rest the pointer over the item . . .

About collecting and pasting multiple items . . .

Comparing the Office Clipboard and Windows Clipboard - The Office Clipboard is separate from the Windows Clipboard. When you copy multiple items to the Office Clipboard, the last item you copy is always copied to the Windows Clipboard. When you clear the Office Clipboard, the Windows Clipboard is also cleared. When you use the Paste command on the Edit menu, the Paste button, or the paste shortcut key (CTRL+V), you paste the contents of the Windows Clipboard.

Office Clipboard capability - The Office Clipboard can hold up to 12 items. If you try to copy a thirteenth item to it, a message asks whether you want to remove the first item from the Clipboard or, instead, not copy the thirteenth item. The collected items remain in the Office Clipboard until you close all open Office programs.

You cannot paste multiple items or display the Office Clipboard in a program other than Microsoft Excel, Word, Access, Outlook, or PowerPoint. However, if the Office Clipboard is shown in any Office program, any items you cut or copy in any program will be collected automatically.

The format of information pasted from the Clipboard - How pasted information appears in a document   Information you cut or copy to another program is pasted, if possible, in a format that the program can edit. For example, cells from Microsoft Excel worksheets and records from Microsoft Access are pasted into Word as Word tables, complete with column widths and font formatting. Text separated by tab characters from Word is pasted into Microsoft Excel in rows and columns of cells, and records from Microsoft Access are pasted into a Microsoft Excel worksheet as rows with each field in a separate column

If a program can't edit the information, it inserts it as an embedded object, which you can edit in the source program by double-clicking the object. If the information can't be inserted as an embedded object — for example, you're copying the information from a program that does not support OLE, the information is pasted as a static picture that cannot be edited

How to format pasted information ... To control the format of information pasted from the Clipboard, use the Paste Special command (Edit menu) instead of Paste
Project Member

Comment 29 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Type-Bug -Area-WebKit -WebKit-Core -Area-Compat Cr-Content Type-Compat Cr-Content-Core
Project Member

Comment 30 by bugdroid1@chromium.org, Apr 6 2013

Labels: -Cr-Content Cr-Blink

Comment 31 by Deleted ...@, Oct 18 2013

I0m having the same issue since a couple of weeks ago. A little annoying
Do the update, get the latest version of Chrome.  It's been fixed for a while now.

Comment 33 by Deleted ...@, Jan 20 2014

This is now happening again with excel 2007 and Version 32.0.1700.76 m.  How do we reopen this issue?

Comment 34 by Deleted ...@, Jul 1 2014

this is still an ongoing STUPID issue. So much for chrome. 

Comment 35 by Deleted ...@, Jul 1 2014

This problem is not seen in Firefox

It doesn't happen in my version of Chrome any more either
I have this issue also, only thing that is stopping me from using chrome instead of firefox at work.

Comment 38 by Deleted ...@, Oct 28 2014

I need help with hiding Address bar in Chrome browser when ever it is opened

Comment 39 by tkent@chromium.org, Jul 15 2015

Labels: -Cr-Content-Core

Comment 40 by yosin@chromium.org, Apr 20 2016

Components: -Blink Blink>Editing>Paste
Labels: -Mstone-X mstone-X
Project Member

Comment 41 by sheriffbot@chromium.org, Apr 20 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue.
The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 42 by yosin@chromium.org, Apr 21 2017

Status: Available (was: Untriaged)
Labels: Pri-3
Project Member

Comment 44 by sheriffbot@chromium.org, Oct 8

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 45 by yosin@chromium.org, Oct 11 (5 days ago)

Status: Available (was: Untriaged)

Sign in to add a comment