如何取消excel.exe |
答題得分者是:syntax
|
甘蔗夫
一般會員 發表:76 回覆:19 積分:19 註冊:2004-08-25 發送簡訊給我 |
|
syntax
尊榮會員 發表:26 回覆:1139 積分:1258 註冊:2002-04-23 發送簡訊給我 |
|
甘蔗夫
一般會員 發表:76 回覆:19 積分:19 註冊:2004-08-25 發送簡訊給我 |
|
syntax
尊榮會員 發表:26 回覆:1139 積分:1258 註冊:2002-04-23 發送簡訊給我 |
1. 只是建議你修改標題,這樣人才看得懂,不然你會錯過知道解決方式的人
2. 你有執行關閉,但成功了嗎? 3. 方法不只一種,何不試試 ExcelSheet.Application.Quit(); 或 ExcelApp.Quit; ===================引 用 甘蔗夫 文 章=================== Sorry, 用詞不當,我執行下面去關閉程序,但沒用 ExcelBook.OleFunction("Close",InputEdit->Text.c_str()); ExcelApp.OleFunction("Quit"); |
chardbcb
一般會員 發表:0 回覆:1 積分:0 註冊:2006-10-11 發送簡訊給我 |
可以參考 Variant::Exec example
如下說明 [code cpp] #include // declare global Variant for Automation interface Variant MSWord; //Declare AutoCmd objects for methods on Automation interface PropertySet VisTrue("Visible"); Procedure QuitFalse("Quit"); PropertyGet GetDocs("Documents"); PropertyGet GetSel("Selection"); Function DocAdd("Add"); Procedure AddText("TypeText"); Procedure AddDate("InsertDateTime"); Procedure AddPara("TypeParagraph"); [/code] __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { //Initialize AutoCmd objects with their parameters VisTrue << true; QuitFalse << false; //Set up named parameters for date/time method call AddDate << NamedParm("DateTimeFormat", "dddd, dd MMMM yyyy") << NamedParm("InsertAsField", false); } void __fastcall TForm1::btnStartWordClick(TObject *Sender) { MSWord = Variant::CreateObject("Word.Application"); MSWord.Exec(VisTrue); } void __fastcall TForm1::btnStopWordClick(TObject *Sender) { //Should be able to just use the 2nd statement //but MS Office 97 doesn't adhere to the lifetime //management aspects of the MS COM spec. MSWord.Exec(QuitFalse); MSWord = Unassigned; } void __fastcall TForm1::btnNewDocClick(TObject *Sender) { Variant DocCollection = MSWord.Exec(GetDocs); DocCollection.Exec(DocAdd); } void __fastcall TForm1::btnInsertTextClick(TObject *Sender) { Variant Sel = MSWord.Exec(GetSel); AddText.ClearArgs(); Sel.Exec(AddText << WideString(memTextForWord->Text)); Sel.Exec(AddDate); Sel.Exec(AddPara); } |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |