Undeclared identifier: 'xlText' |
缺席
|
fivker
一般會員 ![]() ![]() 發表:24 回覆:38 積分:12 註冊:2006-12-05 發送簡訊給我 |
http://delphi.ktop.com.tw/board.php?cid=30&fid=66&tid=61435
wb.SaveAs(Filename:='C:\t2.txt', FileFormat:=xlText);//這一行 請問各位高手,是什麼原因造成的? 有沒有方法可以解決?感謝感謝 。 編輯記錄
fivker 重新編輯於 2008-01-15 15:49:25, 註解 對不起各位,我已經找到答案,是因為沒有加const xlText = -4158‧
|
ace33022
一般會員 ![]() ![]() 發表:2 回覆:41 積分:23 註冊:2004-05-14 發送簡訊給我 |
這個程式我沒測,不過就語法來看,依底下紅字部份改一下,看能不能用唄
const應該是常數定義,有可能原先的版本未改好吧,希望可以幫你解決這個問題。 ===================引 用 fivker 文 章=================== http://delphi.ktop.com.tw/board.php?cid=30&fid=66&tid=61435 var ex, wb: Variant; //const xlText = -4158; begin try ex := CreateOleObject('Excel.Application'); ex.Visible := true; wb := ex.WorkBooks.Open('c:\t1.xls'); wb.SaveAs(Filename:='C:\t2.txt', FileFormat:=xlText); wb.Saved := true; // to avoid quit message ex.Quit; except on E: Exception do ShowMessage('error: ' E.Message); end; end; 我使用上述中,timhuang的程式時,compile時出現下列錯誤訊息。 Undeclared identifier: 'xlText' 請問各位高手,是什麼原因造成的? 有沒有方法可以解決?感謝感謝 。 |
Coffee
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:31 回覆:878 積分:561 註冊:2006-11-15 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |