Excel可以将单元格解释为HTML吗? [英] Can Excel interpret a cell as HTML?

查看:228
本文介绍了Excel可以将单元格解释为HTML吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Aspose.Cells以编程方式构建Excel文档。这很好。其中一个单元格是一个原始的HTML块。我想知道是否可以告诉Excel(以任何方式,包括GUI - 您不需要知道Aspose API)来解析和显示一个单元格为HTML。现在,它只是显示为文本格式,标签和所有的原始HTML。



我知道Excel能够将HTML粘贴到其中,但它看起来像它只是解析它自己,然后Excel-ifies它为你,它不存储HTML,所以它不是实际解析它并显示为HTML。此外,我无法弄清楚如何复制此粘贴功能。



谢谢。

解决方案

不幸的是答案是否定的。



Excel有两个HTML选项:




  • 打开一个HTML文件,它将渲染HTML,排序,但不会在单元格中包含任何实际的HTML

  • 在单元格中存储HTML,但是作为未格式化的文本。



您可能可能会提出一个宏,让您将HTML输入单元格,然后保存HTML作为文档,在另一个Excel实例中打开,然后抓取格式化的HTML并将其放在原始文档中;这样你就有两个列,一个是HTML,一个是输出。不过很难看到非常不要这样做:0)


I'm using Aspose.Cells to build an Excel document programmatically. This works great. One of the cells, though, is a block of raw HTML. I'm wondering if it is possible to tell Excel (in any fashion, including the GUI - you don't need to know the Aspose API) to parse and display a cell as HTML. Right now, it just shows up as the raw HTML in text format, tags and all.

I know Excel is capable of having HTML pasted into it, but it looks like it just parses it on its own and then Excel-ifies it for you, and it doesn't store the HTML, so it's not actually parsing it and displaying it as HTML. Plus, I can't figure out how to replicate this paste functionality anyway.

Thanks.

解决方案

Unfortunately the answer is no.

Excel has two HTML options:

  • Open a HTML file, which will sort of render the HTML, sort of, but won't contain any actual HTML in cells
  • Store HTML in cells, but as unformatted text.

You could, maybe possibly, come up with a macro that lets you enter HTML into a cell, then saves that HTML as a document, opens it up in another instance of Excel, then grabs that formatted HTML and places it in the original document; that way you would have two columns, one with the HTML, and one with the output. It would be very unsightly though. Don't do it :0)

这篇关于Excel可以将单元格解释为HTML吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆