New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Can't paste HTML or JSP code as text into excel 2007

Formulas, Functions, Formatting, Charts, Data Analysis, etc.

Can't paste HTML or JSP code as text into excel 2007

Postby thorlp » Wed Dec 07, 2011 8:38 pm

Hi,

I'm trying to paste code from a text editor into excel 2007 and it keeps interpreting the code.

For example I have pasted html into notepad and then into excel and it diplays in the rendered html and NOT as text. I have also tried the same with jsp with the same result.

I have found a couple of instances on the internet where others have identified a similar problem but either they haven't been able to resolve it or the links to the solution are broken. I can find no option in Excel that will turn this rendeering behaviour off.

This isn't a prblem with sql or unix shell script or other code that doesn't contain html or similar.

If anyone can solve this for me I'd be really grateful.

Cheers,

Thor
  • 0

thorlp
Rookie
 
Posts: 2
Joined: Dec 7, 2011
Reputation: 0

Re: Can't paste HTML or JSP code as text into excel 2007

Postby Don » Wed Dec 07, 2011 9:34 pm

Hi there!

Can you include a sample or give an example of how you are doing this? I'm assuming you aren't just pasting the html into a cell in Excel!?
  • 0

Don
Moderator
 
Posts: 733
Joined: Dec 4, 2011
Reputation: 2
Excel Version: 2010

Re: Can't paste HTML or JSP code as text into excel 2007

Postby thorlp » Wed Dec 07, 2011 11:56 pm

How am I doing it?
================

1. Open the jsp file.
2. Copy and paste the content of the file into Notepad.
3. Copy and paste the contents of the NotePad into a blank excel worksheet.

---[ Expected Result ]----

Every row in the code will appear on its own row in the worksheet.

---[ Actual Result ]----

The code is interpreted by Excel and appears as panels, & fields and buttons.

WorkAround
===========

My colleague came up with a solution.

1. Rename the jsp file as a csv file.
2. Open the csv file with Excel.
3. Copy the jsp code in the csv file to the clipboard.
4. Paste the clipboard into the excel file.

---[ Actual Result ]----

Code appears as code.

Observation
---------------
It would appear that the whatever trickery that Excel is doing is bypassed once the code text is in the Excel csv file. we would still be interested to know why the bloody hell excel is doing this and more importantly how this 'feature' can be disabled.
  • 0

thorlp
Rookie
 
Posts: 2
Joined: Dec 7, 2011
Reputation: 0

Re: Can't paste HTML or JSP code as text into excel 2007

Postby Don » Thu Dec 08, 2011 10:23 am

I really have no idea why this would be happening. When I copy and paste code into a worksheet, there is no rendering that goes on. All of the code just appears as text. However, when I go to a webpage and copy contents from the rendered webpage and paste that into Excel, many of the elements retain their formatting and other html elements. But, just viewing the source and copy/pasting that does not render anything, at least in my case.
  • 0

Don
Moderator
 
Posts: 733
Joined: Dec 4, 2011
Reputation: 2
Excel Version: 2010


Return to General Excel Questions

Who is online

Users browsing this forum: No registered users and 55 guests

cron