本文介绍了Excel(办公室)和自动化(再次):最新智慧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

着名的KB257757页面告诉我们"Microsoft不推荐或支持服务器端Office自动化"的所有原因。自Office首次发布以来,这一直是一个FAQ主题。但是经过这些年来,Office 2010,.NET 4和其他进步,我们仍然将KB257757用于此功能。

The famous KB257757 page tells us all the reasons why "Microsoft does not recommend or support server-side Automation of Office." This has been a FAQ topic since Office was first published. But after all of these years, Office 2010, .NET 4, and other advances, we're still referred to KB257757 for this functionality.

为什么Microsoft没有回复为无头应用程序提供无UI的Office文档操作SDK? Open XML是否可以解决这个问题? Excel Services?

Why hasn't Microsoft responded to this with a UI-less Office document manipulation SDK for headless applications? Is Open XML the answer to this? Excel Services?

作为一个当前的例子,我的客户说"我想要做的就是......"。打开Excel文档,进行更改并保存。为了在几年前解决这个问题,我开始使用SpreadsheetML并接受其限制(没有图像,图表等)。经过多年通过XML生成
丰富的Excel文档,但现在我们正在寻求下一步,我的客户要求提供SpreadsheetML不支持的图像和其他对象。我的理想方法是通过Excel自动化打开XML文件,嵌入图像,然后将
保存为XLS。但是在Windows服务中执行此操作总是会遇到问题。如果我可以打开我的v2003兼容XML,使用OpenXML SDK修改它以将图像嵌入单元格,将其保存为Excel 2010包,然后以某种方式将其从v2010
转换为v2003 XLS,那将是很棒的。由于没有添加任何不支持的功能,因此该转换中不会丢失任何功能。

As a current example, as my clients say "all I want to do is..." open Excel documents, make changes, and save them. To get around this issue years ago, I started using SpreadsheetML and accepted its limitations (no images, charts, etc). After years of generating rich Excel documents via XML, but now looking to take the next step, my clients are asking for images and other objects which are not supported by SpreadsheetML. My ideal approach would be to open an XML file via Excel automation, embed an image, then save as an XLS. But doing this in a Windows Service is always subject to issues. It would be great if I could open my v2003 compatible XML, modify it with the OpenXML SDK to embed images in cells, save it as an Excel 2010 package, then somehow convert it from v2010 down to a v2003 XLS. No features would be lost in that conversion since nothing unsupported is being added.

因此,当我正在寻找通过Windows服务在XLS中操作图像的问题的解决方案时,我我也希望有人可以澄清为什么我们可能需要处理完全不同的技术,比如OpenXML或Excel Services才能做一些事情
这么简单......或者......我们呢?

So while I'm looking for a solution to this problem of manipulating images in a XLS via a Windows Service, I'm also hoping someone can clarify why we may need to deal with completely different technologies like OpenXML or Excel Services in order to do something so simple ... or ... do we?

谢谢!

推荐答案

为什么不使用Office 2007或Office 2010? Open xml可以处理这些文件,例如操作它们中的图像。以下是关于将图像插入Excel以供参考的文章:

Why not use Office 2007 or Office 2010? Open xml can process these files such as manipulating images in them. Here is the article about inserting images into Excel for you to reference:

http://polymathprogrammer.com/2009/11/30/how-to-insert-an-image-in-excel-open-xml/

希望这会有所帮助。

问候,


这篇关于Excel(办公室)和自动化(再次):最新智慧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 09:05