It's not supported.
Years ago our app teams built web sites that would use the COM interface to Word and Excel. I had to schedule a task to periodically kill hung processes on my IIS servers. Office apps expect to interact with a real user who can do things like "click ok to continue".
We purchased OfficeWriter and converted the sites. https://support.softartisans.com/support-95.aspx
I don't know if any open source solution exist or not.