全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1775
推到 Plurk!
推到 Facebook!

使用Delphi 6 's TEXCELWorkSheet 產生EXCEL 之問題

答題得分者是:delphiwww
ammon
一般會員


發表:5
回覆:11
積分:3
註冊:2002-06-25

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-11-18 13:47:49 IP:61.31.xxx.xxx 未訂閱
各位好, 想請教有關在Delphi 6 TExcelWorkSheet 此component產生Excel檔案, 若是針對產生出來的欄位想要設定[最適欄寬]此功能,不知從何下手, 不知道是否有人已經對此有研究,可以提供解法,謝謝! Ps. 使用CreateOleObject此法的設定欄寬無法適用於此component的設定 Ammon
------
ammon .^_^.
andersonhsieh
版主


發表:33
回覆:531
積分:439
註冊:2002-06-10

發送簡訊給我
#2 引用回覆 回覆 發表時間:2002-11-18 14:03:59 IP:211.20.xxx.xxx 未訂閱
引言: 各位好, 想請教有關在Delphi 6 TExcelWorkSheet 此component產生Excel檔案, 若是針對產生出來的欄位想要設定[最適欄寬]此功能,不知從何下手, 不知道是否有人已經對此有研究,可以提供解法,謝謝! Ps. 使用CreateOleObject此法的設定欄寬無法適用於此component的設定 Ammon
可以試試以下方法看看 ExcelWorksheet1.Range['A1','A1'].AutoFit := TRUE; @@~~飛翔在天際的精靈~~@@
------
@@~~飛翔在天際的精靈~~@@
delphiwww
資深會員


發表:145
回覆:363
積分:368
註冊:2002-03-13

發送簡訊給我
#3 引用回覆 回覆 發表時間:2002-11-18 14:08:49 IP:202.145.xxx.xxx 未訂閱
你可以參考Delphi & Excel(http://delphi.ktop.com.tw/forum.asp?FORUM_ID=943) 然後增加一個Button其caption為最適欄寬 在onclickevent上加入 Button4Click(nil); //先select (ExcelApplication1.Selection[Lcid] as Range).Columns.AutoFit; 你也可以改改成你需要的範圍(range),離如 ExcelWorksheet1.Range[_Cell1,_Cell2].columns.autofit; 發表人 - delphiwww 於 2002/11/18 14:11:06
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#4 引用回覆 回覆 發表時間:2002-11-18 14:10:08 IP:147.8.xxx.xxx 未訂閱
Try ExcelWorksheet.Cells.AutoFit
ammon
一般會員


發表:5
回覆:11
積分:3
註冊:2002-06-25

發送簡訊給我
#5 引用回覆 回覆 發表時間:2002-11-18 14:24:23 IP:61.31.xxx.xxx 未訂閱
引言: Try ExcelWorksheet.Cells.AutoFit
感謝各位的回覆,不過經過測試,三位的方法皆不行。 在complier時,會出現 left side cannot be assigned to 此error message Ammon
------
ammon .^_^.
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#6 引用回覆 回覆 發表時間:2002-11-18 14:41:18 IP:147.8.xxx.xxx 未訂閱
引言:感謝各位的回覆,不過經過測試,三位的方法皆不行。 在complier時,會出現 left side cannot be assigned to 此error message Ammon
Use AutoFit as a procedure and don't assign any value to it.
ammon
一般會員


發表:5
回覆:11
積分:3
註冊:2002-06-25

發送簡訊給我
#7 引用回覆 回覆 發表時間:2002-11-18 15:05:12 IP:61.31.xxx.xxx 未訂閱
引言:
引言:感謝各位的回覆,不過經過測試,三位的方法皆不行。 在complier時,會出現 left side cannot be assigned to 此error message Ammon
Use AutoFit as a procedure and don't assign any value to it.
抱歉! 一時沒注意到,現在測試發現使用方法應該如同delphiwww所寫一樣才是 感謝各位的協助 ~~ Ammon
------
ammon .^_^.
系統時間:2024-04-28 8:18:17
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!