Web App and ActiveX

5 次查看(过去 30 天)
C. Wilson
C. Wilson 2023-10-31
评论: C. Wilson 2023-11-26
I have written a Web App which processes some information and then saves it to an Excel workbook for the user to download. I am using complex formatting in the Excel workbook which requires ActiveX. Because ActiveX is not supported with Web Apps, I compiled the MATLAB function that generates the Excel workbook using ActiveX into a separate program. The Web App will call this separate program from the command line using the system command. The Web App works correctly and the separately compiled function runs correctly when launched from the Command Prompt in Windows. However, when I deploy the Web App to the server, it gives an error in activexserver.m on line 89 "MATLAB:COM:servercreationfailed". Does the Web App limitation apply to separately compiled programs that are launched from the command line? If so, is there any way around this?

回答(1 个)

Divyanshu
Divyanshu 2023-11-24
Hi C.Wilson,
I understand that you are trying to work with Excel using ActiveX in deployed environment.
Unfortunately the function is not supported on Web App. Moreover, using Excel in Web Apps is not recommended as per Microsoft's considerations in their help page:
"Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment."
The recommended approach is to use "readtable"/ "writetable" functions without invoking the Excel behind the scenes ('UseExcel=false').
Please refer the following documentation for better understanding:
I hope it helps!
Thank you.
  1 个评论
C. Wilson
C. Wilson 2023-11-26
Hi,
Thank you for the detailed answer. I realize that it is not recommended, but I'm still not understanding why this is happening. Why it will not work when run on the command line via the Web App? The separatly compiled program works from the command line on the server when run outside of the Web App. The server only has the runtimes that were installed with the Web App. It does not have a full install of MATLAB. The only information passed to the program is the file path to the MAT file for parsing into the Excel template. When called via the command line within the app, does it see a different runtime that grandfathers in the restrictions in the Web App? As far as I can tell, that would be the only way this restriction would flow to a completely separate program that is run from the command line.
Thank you for humoring my curiousity for how this occurs.

请先登录,再进行评论。

标签

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by