Web App and ActiveX

3 visualizzazioni (ultimi 30 giorni)
C. Wilson
C. Wilson il 31 Ott 2023
Commentato: C. Wilson il 26 Nov 2023
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?

Risposte (1)

Divyanshu
Divyanshu il 24 Nov 2023
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 Commento
C. Wilson
C. Wilson il 26 Nov 2023
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.

Accedi per commentare.

Tag

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by