- Cesar Armando Garcia Liñan
- PowerBuilder
- Friday, 11 December 2020 05:50 PM UTC
Hello. We are migrating a client/server desktop application from PB 17 to PB 19. Some of our OLEObject functionality appears to have broken, and I'm looking for some help.
Here is a snippet of the code in question:
String str_run
OleObject wsh
Integer li_rc
wsh = CREATE OleObject
li_rc = wsh.ConnectToNewObject( "WScript.Shell" )
IF li_rc < 0 THEN
messagebox("error","error de Conexión con PSPAD")
RETURN False
END IF
//result = myoleobject.ConnectToNewObject("excel.application")
str_run = GetCurrentDirectory()+'\pspad\PSPad.exe ' + str_file_name + ' -h'
wsh.RUN(str_run)
Sleep(1)
wsh.sendkeys("{INSERT}")
wsh.sendkeys("{DEL}")
wsh.sendkeys("{DEL}")
wsh.sendkeys("{DEL}")
wsh.sendkeys("^{S}")
wsh.sendkeys("^{F4}")
wsh.sendkeys("^{F4}")
wsh.DisconnectObject()
RETURN True
In PB 17, everything works as expected. In PB 19, I get the following error:
Power Builder application execution error (R0035) Application terminated. Error: Error calling external object function run at linea 13 in function gf_quita_bom_file_hex of gf_quita_bom_file_hex (wsh.run(str_run))
Any thoughts? Thank
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.