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?