Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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.):

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!
Posted
Comments
Bala Selvanayagam 2-Sep-13 5:32am    
It could be a permission issue.

I remember similar issues when working with COM somes time back and we grant permission on ht object so that the IIS call can instantiate.

I do not remember how to grant permission as it was some times back i worked on COM.

May be do a google ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900