PHPExcel克隆.xlsm与宏

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...

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 ?

Thanks .

php

2个回答



首先:</ p>


  • PHPExcel不支持读取Excel宏(.xlsm 文件。</ li>
    </ ul>

    第二:</ p>


    • 它不支持宏。 </ li>
      </ ul>

      我不知道任何支持此功能的PHP库。 </ p>

      我确信你能做到这一点的唯一方法是使用PHP COM扩展。</ p>

      可能</ strong>工作的COM的唯一选择 是Ilia Alshanetsky的 Excel扩展 </ p>
      </ div>

展开原文

原文

First:

  • PHPExcel does not support reading Excel macro (.xlsm) files.

Second:

  • it doesn't support macros.

And I'm not aware of any PHP libraries that support this.

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.

The only alternative to COM that may work would be Ilia Alshanetsky's Excel extension

douwei1950
douwei1950 谢谢你澄清gcb ...我知道Ilia的扩展只是对libXl的绑定,但是并不知道libXl究竟做了什么并且不支持
接近 9 年之前 回复
doomli3721
doomli3721 excel扩展只是libXl的绑定,它也不支持宏或图形
接近 9 年之前 回复



这个帖子有点陈旧,但我遇到了同样的问题,我需要用PHP修改Excel文件。 我知道没有PHP librairy支持编辑Excel文件而不会对宏造成负面影响。 </ p>

但是,LibXL库支持从版本3.3.1开始保留宏。 它不是用PHP编写的,但我们最终做的是用C ++编写Excel编辑,我们通过exec()方法从PHP调用c ++程序。 它运作良好,表现非常好。 希望它对某人有所帮助。</ p>
</ div>

展开原文

原文

This thread is a little old, but I had the same issue where I needed to modify Excel files with macros from PHP. No PHP librairy that I know support edit Excel files without negatively impacting the macros.

However the LibXL library supports the preservation of macros as of version 3.3.1. It's not written in PHP, but what we ended up doing is to write our Excel editing in C++ and we called that c++ program from PHP via the exec() method. It worked very well and had very good performance. Hope it helps somebody.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐