Thanks for posting this code.
Aside from triggering the ue_set_xlsx_file event, I see no importing of any data in this code. On what line does the error occur?
I pasted this code into a command button Clicked event, commented out statements that did not apply, such as references to st_status, ddlb_wsheets, etc. , commented out the ue_set_xlsx_file event call, and had the code open an existing Excel spreadsheet, stepped through in the debugger, and it works fine.
I suggest you code a more robust "catch" block, using the OLERuntimeError object (a descendant of the more generic RuntimeError object) when working with OLE, as it has some additional properties that may be helpful to include in your MessageBox text. Refer to the PB Help topic for "RuntimeError object" to see the additional properties listed that are provided in the OLERuntimeError object. Here is a code snippet I use when working with OLE (this example is from code that interacts with Outlook):
Try
If Not IsValid(iole_application) Yhen
iole_application = CREATE OLEObject
li_rc = iole_application.ConnectToNewObject('Outlook.Application')
End If
Catch(OLERuntimeError lore_1)
as_msg = 'An error has occurred while connecting to Outlook.~r~n~r~n' + &
'Error number: ' + String(lore_1.Number) + '~r~n' + &
'Line number: ' + String(lore_1.Line) + '~r~n' + &
'Description: ' + lore_1.Description + '~r~n' + &
'Source: ' + lore_1.Source + '~r~n' + &
'Message: ' + lore_1.Text + '~r~n~r~n' + &
'Mail was not sent.'
Return -1
End Try
Doing something similar in your app will provide you with better diagnostic information to help you troubleshoot.
Are you running this migrated app now as 64-bit and as 32-bit before?
Is Excel installed? Is it a version that supports the .xlsx file format?
I am thinking that the error is created due to the Excel Interop Class is not installed in the server.
In this server, even the PowerBuilder Virtual Machine is Not installed, due to politics in the company.
Normally i copy the PowerBuilder Runtime files in the folder of the application, which enhance its startup time.
I suppose, it is necessary update those DLLs using a Microsoft Installer.
Do you have any recommendation about the Excel Interop registry entry or its install.
Thank you very much.
I'm not sure this will help, but I found the following via a web search:
https://www.dllme.com/dll/files/microsoft_office_interop_excel
Good luck!