I have a string that contains html and it is written to a .xls file via a excel writer class. When I open the file with excel the column that contains the html renders in the column...I know nothing about excel but I was expecting to see just the raw string. When I attempt to save the file as a text tab delimited file the html disappears. I want to retain the html. Is there a special way to encode the html string before writing it to a file? Do I need to escape the html somehow?
Thanks.
html string in excel
Moderator: General Moderators
- SmokyBarnable
- Forum Contributor
- Posts: 105
- Joined: Wed Nov 01, 2006 5:44 pm
- SmokyBarnable
- Forum Contributor
- Posts: 105
- Joined: Wed Nov 01, 2006 5:44 pm
Re: html string in excel
I solved this problem by using htmlentities on my html string before writing it the .xls file. The html text displays properly now, and when saving it to a text file the html remains as it should. I don't really understand why it worked though. Can anyone explain it to me?
Thanks.
Thanks.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: html string in excel
Hint: View->source