掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Delphi2010 から Excel操作について (ID:40108)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
あれ、定義の問題じゃないのか?と思ってDelphi2009+Excel2000の環境で 手抜きプログラムを作って試してみたけど正常に動いたよ。 uses Variants, ComObj; procedure TForm1.Button1Click(Sender: TObject); const xlValues = -4163; var Excel : Variant; Sheet : Variant; Row : integer; begin try try //起動中のExcelを探してそいつのアクティブシートにアクセス Excel := GetActiveOleObject('Excel.Application'); Sheet := Excel.ActiveWorkbook.ActiveSheet; except exit; end; Row := Sheet.Cells.Find( what:='AB', LookIn:=xlValues ).Row; Caption := IntToStr(Row); finally Sheet := unAssigned; Excel := unAssigned; end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.