PHPExcel克隆带有宏的.xlsm [英] PHPExcel clone .xlsm with macros
问题描述
我正在尝试使用PHPExcel读取,克隆和写入以及.xlsm文件,但出现错误: 致命错误:在...中出现消息"Worksheet!G177->公式错误:发生意外错误"的未捕获异常"Exception".
I'm trying to read, clone and write and .xlsm file with PHPExcel but I get an error: Fatal error: Uncaught exception 'Exception' with message 'Worksheet!G177 -> Formula Error: An unexpected error occured' in...
任何人都知道如何读取,克隆和写入带有宏的Excel文件,我的意思是宏位于模板(我正在读取的文件)中,我只想克隆该文件并写在上面,并保持新文件中的宏. PHPExcel有可能吗?还有另一个图书馆可以做到这一点吗?
Anybody know how can I read, clone and write and Excel file with macros, I mean the macros are in a template (the file that I reading) I just want to clone that file and write on it, and just keep the macros in the new file. Is that possible with PHPExcel ? is there another library to do that ?
谢谢.
推荐答案
首先:
- PHPExcel不支持读取Excel宏(.xlsm)文件.
第二:
- 它不支持宏.
我还不知道任何支持此功能的PHP库.
And I'm not aware of any PHP libraries that support this.
我确定可以执行此操作的唯一方法是使用PHPs COM扩展,在已安装MS Excel本身的服务器上.
The only way that I know for certain that you could do this would be using PHPs COM extension, on a server with MS Excel itself installed.
可能可以替代COM的唯一方法是Ilia Alshanetsky的
The only alternative to COM that may work would be Ilia Alshanetsky's Excel extension
这篇关于PHPExcel克隆带有宏的.xlsm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!