Dear Ma Jack,
I think I now finally understand the problem.
Me, I'm using office 365 and when I try to open the xls file, I get:
When I answer "Yes", I get:
So I've done some tests:
dw_1.saveas("作成 excel8.xls", excel8!,true) // BAD
dw_1.saveas("作成 Excel5.xls", Excel5!,true) // BAD
dw_1.saveas("作成 Excel.xls", Excel!,true) // it works, but you'll need to adjust office's Trust Center settings
dw_1.saveas("作成 XLSX.xlsx", XLSX!,true) // it works, but Office thinks it's a "file from the internet" and you'll need to adjust office's Trust Center settings
messagebox("","completed")
So you are right: this is a bug either in Powerbuilder or Office itself. (or both).
In addition, the PB help says this:
Obsolete values
The following SaveAsType values are considered to be obsolete and will be removed in a future release: Excel!, WK1!, WKS!, SYLK!, dBase2!, WMF!. Use Excel8!, XLSB!, or XLSX! for current versions of Microsoft Excel!, and EMF! in place of WMF!.
It doesn't mention Excel5!, but let's assume that one will also disappear in the future and doesn't solve your problem anyway giving a bad result.
I've done the same test with PB2022 R2, and get the same results.
So you have to get some kind of workaround for this.
I think you should report this as a bug on https://www.appeon.com/standardsupport/newbug
regards,
MiguelL
The best option is probably what you suggested in that case or for Appeon to resolve the issue.
regards