Yesterday, I tested it.
- Code: Select all Expand view
LOCAL cFileName
LOCAL cString := "所有 Excel 檔案|*.XLS|" + ;
"Excel 檔案 |*.XLS|" + ;
"所有檔案 | *.*"
cFileName := cGetFile( cString, "請選擇要抓入之檔案名稱", , "" )
cFileName := cGetFile32( cString, "請選擇要抓入之檔案名稱", , "" )
cFileName Get string below:
D:\客戶資料2.xls
or
R:\Project\CustomerRelationshipManagementErp\SQL-Unicode-SDI\242\Fivetech\Exe32\客戶資料2.xls
Run this code not work below:
- Code: Select all Expand view
If ! File( ( cFileName ) ) //==> Alwayse appear File not
- Code: Select all Expand view
oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cFileName)
or
- Code: Select all Expand view
oExcel := CreateObject( "Excel.Application" )
oExcel:WorkBooks:Open(cFileName)
Got Error message below:
Error description: Error Excel.Application:WORKBOOKS/14 DISP_E_BADPARAMCOUNT: OPEN
So, If I change Chinese File Name to English Name.
It's work fine.