SaveDisplayedDataAs error code -1
- New
- How-to
-
Larry Gross
- PowerBuilder
- Monday, 5 October 2026 06:17 PM UTC
We are using Powerbuilder 2025 build 3683 and really like the feature of saving a data window with SaveDisplayedDataAs. It works great in the IDE environment. However when compiled it throws a -1 error code. We are connecting to an Oracle database and all the other windows and functions appear to work great. Here the code that we are using.
int li_rtn,li_response
string ls_file, ls_path, ls_filename, ls_null
li_rtn = GetFileSaveName('Save Report As', ls_path,ls_filename,'XLSX')
li_rtn = Dw_5.SaveDisplayedDataAs (ls_path, XLSX!)
if li_rtn = 1 then
li_response = MessageBox("Open File","Would You Like to Now Open the FIle?", question!,yesno!)
if li_response <> 1 then
else
ShellExecuteA( 0, "open", ls_path, ls_null, ls_null, 1 )
end if
else
MessageBox("Error", "Export failed with error code: " + string(li_rtn))
end if
PS our deployment process is placing the known required DLLs and exe in the same folder on the client's work station.
Larry
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.