在 Web 应用程序后端使用带有宏的 Excel 电子表格
我面前有一场建筑噩梦,想要清除一些细节。
因此,问题如下:
如何构建一个 Web 应用程序,使用埋藏在 Excel 电子表格深处的一些宏作为计算后端?
背景: 我的客户有一个 Excel 电子表格为他做一些计算(因此在某些方面它是一个 Excel 应用程序)。现在他愿意拥有一个使用相同 Excel 电子表格作为后端的 WEB 应用程序。是的,正如所说:让 Web 前端对此 Excel 电子表格中的宏进行查询并获取计算数据。不,我无法查看宏源并将其翻译为我的目标语言,因为电子表格受密码保护,无法编辑。
最好不要改动的主要 Web 服务器是 Apache。我最精通的目标开发语言是PHP。
我已阅读有关 Excel<->VB 互操作性的 Microsoft 支持文章 这里有关于 Excel 的问题<->C#互操作性 并得出结论,该任务可以通过下一个数据流实现:
Apache ->后端的一些 C#.NET / VB.NET 应用程序作为中继 ->我的 Excel 电子表格 ->返回中继-> Apache
,但我当然认为它太可怕了,我想要一些更明智的解决方案。
I have an architectural nightmare lying before me and want to clear some details.
So, the question is as follows:
How can someone build a web application which uses some macros buried deep in the Excel spreadsheet as a back-end for computations?
The background:
My client has an Excel spreadsheet doing some calculation for him (so it's in some ways an Excel application). Now he is willing to have a WEB app using the same Excel spreadsheet as a back-end. Yep, it's as said: to have a web front-end doing queries to the macros in this Excel spreadsheet and getting calculated data back. No, I cannot look at the macros source and translate it to my target language, because the spreadsheet is password-protected from editing.
The main web server which better be left untouched is Apache. The target development language I most proficient with is PHP.
I have read the Microsoft Support article about Excel<->VB interoperability and question here about the Excel<->C# interoperability and concluded that the task is possible with the next dataflow:
Apache -> Some C#.NET / VB.NET app in backend as a relay -> my Excel spreadsheet -> back to relay -> Apache
but of course I think it's just horrible and I want some more sensible solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果隐藏在电子表格中的宏是 VBA,则没有干净的方法 (AFAIK) 在服务器上运行电子表格。
有一些可用的工具声称能够将包含 VBA 的 Excel 电子表格编译为可以在服务器上运行的可执行文件,但我没有使用它们的经验,因此不知道哪一个(如果有的话)适合您的情况。
If the macros buried in the spreadsheet are VBA there is no clean way (AFAIK) of running the spreadsheet on a server.
There are some tools available that claim to be able to compile an excel spreadsheet including VBA into an executable that you could run on a server, but I have no experience of them so do not know which, if any, would suit your situation.