PB转Ecxcle shi,save as如果不保存,则系统出错.why?
PB转Ecxcle shi,save as如果不保存,则系统出错.why?
参考这段代码
String ls_File, ls_Path, ls_Ext
GetFileSaveName("Save Report", ls_Path, ls_File, "psr", "PSReport Files (*.psr),*.psr, " + &
"Text Files (*.txt),*.txt, HTML Files (*.htm),*.htm, Excel5 File (*.xls),*.xls")
If Trim(ls_Path) <> "" Then
ls_Ext = Lower(Right(ls_Path, 3))
Choose Case ls_Ext
Case "psr"
dw_1.SaveAs(ls_Path, PSReport!, True)
Case "txt"
dw_1.SaveAs(ls_Path, Text!, True)
Case "htm"
dw_1.SaveAs(ls_Path, HTMLTable!, True)
Case "xls"
dw_1.SaveAs(ls_Path, Excel5!, True)
Case Else
MessageBox("Save Report", "The type of file saved is identified by the extension. " + &
"Use '.psr' for PSReport, '.txt' for Text, '.htm' for HTML Table, or '.xls' for Excel5 ", Exclamation!, OK!)
Return
End Choose
End if