Cannot create ActiveX component error

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
kissgege
Posts: 2
Joined: Wed Aug 28, 2013 8:57 am

Cannot create ActiveX component error

Post by kissgege »

Hi,

I would like to ask for help in the following topic. I made this code called in IIS Web Service in order to create pdf file from office documents (Excel, Word, etc.):

Code: Select all

Dim oSM, oDesk, oDoc As Object 'OOo objects
Dim OpenParam(1) As Object 'Parameters to open the doc
Dim SaveParam(1) As Object 'Parameters to save the doc
oSM = CreateObject("com.sun.star.ServiceManager")
oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
OpenParam(0) = MakePropertyValue("Hidden", True)  ' Open the file hidden
oDoc = oDesk.loadComponentFromURL("file:///" + docFile.Replace("\", "/").Replace("""", ""), "_blank", 0, OpenParam)
SaveParam(0) = MakePropertyValue("FilterName", "writer_pdf_Export")
Call oDoc.storeToURL("file:///" + pdfFile.Replace("\", "/").Replace("""", ""), SaveParam)
oDoc.Close(True)
oDesk = Nothing
oSM = Nothing
The program works perfectly on the developer computer. I have put it on a server, but it wouldn’t work there and it gave me the following error message: Cannot Create ActiveX component. The task is visible in the Task Manager: OpenOffice starts but nothing happens, and in a short time I get the error message.
The server is a Windows 2012 server. I have already set the IIS Application Tools for Administrator rights.
I have also set the rights and identities of Component Services OpenOffice ServiceManagger for Administrator rights. I have set the rights on the File level, too.
I have tried all the solutions I found in Forums, but none of them works.

Please, help me if you can!

Thank you in advance!
Open Office 4 on Windows 7
kissgege
Posts: 2
Joined: Wed Aug 28, 2013 8:57 am

Re: Cannot create ActiveX component error

Post by kissgege »

Hi guys!

Does someone have any hints, tips, suggestions, recommendations. Any lead might help.

Thanks
Open Office 4 on Windows 7
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Cannot create ActiveX component error

Post by rudolfo »

Just a quick thought that has come to my mind: Could this be a 32bit vs 64bit problem?
As you will surely know OpenOffice is a 32bit program on MS Windows, no matter if the underlying OS is 64bit or 32bit. Server 2012 is most probably 64bit and then IIS is also 64 bit.

As far as I remember in the default setting the IIS on a 64bit system won't automatically execute 32 bit applications or COM objects. You have to allow 32bit executables explicitly somewhere in the settings of the user pool. But even then it might be not working. IIS will have to start the VBScript interpreter and that Dll exists in both architecture flavors (64bit and 32bit). IIS can't peek into the code of the VBScript and parse all CreateObject() statements in the script in order to guess if that script would only load "clean" 64bit applications/COM objects or if some of them will be 32bit.

On the other hand you should see the same problem when you start the script manually in a console, because cmd.exe runs usually in the core 64bit system and not in the 32bit sub-system. Except if you start the script in some IDE tool, that is 32bit. In that case the VBScript interpreter would be forced into the 32bit subsystem, as well.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
Post Reply