TExcelApplicationをつかってオートシェイプをシートに追加し、
その背景を透明にしたいと考えています。
エクセルのVBAマクロをみながら、コードを書いたものの
円のシェイプを追加できましたが、これを透明にできません。
環境:WinXP TurboExolore6.0 officeXP,2003です。
var
LCID: Integer;
FileName:string;
ExcelApplication1: TExcelApplication;
ExcelWorkBook1: TExcelWorkBook;
ExcelWorkSheet1: TExcelWorkSheet;
SP:shape;
begin
エクセルファイルを開く
Workbooks.Open( Filename, //FileName: WideString
EmptyParam, //UpdateLinks: OleVariant
EmptyParam, //ReadOnly: OleVariant
EmptyParam, //Format: OleVariant
EmptyParam, //Password: OleVariant
EmptyParam, //WriteResPassword: OleVariant
EmptyParam, //IgnoreReadOnlyRecommended:
EmptyParam, //Orign: OleVariant
EmptyParam, //Delimiter: OleVariant
EmptyParam, //Editable: OleVariant
EmptyParam, //Notify: OleVariant
EmptyParam, //Converter: OleVariant
EmptyParam, //AddToMru: OleVariant
EmptyParam, //Local
EmptyParam, //CorruptLoad
LCID)); //lcid: Integer;
ExcelWorkSheet1.ConnectTo(ExcelWorkBook1.Worksheets[1] as
_WorkSheet);
ExcelWorkSheet1.Activate;
SP:=Excelworksheet1.Shapes.AddShape(9, 100, 100, 150, 150);
SP.Fill.Transparency:=0; ここでエラーがでます。
このようなコーディングはNGなのでしょうか?
よろしくお願いします。
いずれも未確認ですが
http://sciencesystem.g.hatena.ne.jp/bbs/2/32
とか、あと
http://www.torry.ru/pages.php?id=352
にもHow To Work With Microsoft Excel 97 from Delphi
とかあるようなので、参考になるかもしれません。
時間が経過しているので,解決済みかも知れませんが,
サンプルを作成してみました.参考になれば...
http://mrxray.on.coocan.jp/Delphi/plExcel/T_AutoShape.htm
ツイート | ![]() |