T Tassadar Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #2 procedure TForm1.Button1Click(Sender: TObject); var aWorkBook : _Workbook; aSheet : Variant; begin if OpenPictureDialog1.Execute then begin ExcelApplication1.Connect; aWorkBook := ExcelApplication1.Workbooks.Add(EmptyParam, 0); aSheet := aWorkBook.Sheets[1]; aSheet.Range['f1'].Select;//这里是定位图片插入的位置 asheet.Pictures.Insert(OpenPictureDialog1.FileName); ExcelApplication1.Visible[0] := True; ExcelApplication1.Disconnect; end; end;
procedure TForm1.Button1Click(Sender: TObject); var aWorkBook : _Workbook; aSheet : Variant; begin if OpenPictureDialog1.Execute then begin ExcelApplication1.Connect; aWorkBook := ExcelApplication1.Workbooks.Add(EmptyParam, 0); aSheet := aWorkBook.Sheets[1]; aSheet.Range['f1'].Select;//这里是定位图片插入的位置 asheet.Pictures.Insert(OpenPictureDialog1.FileName); ExcelApplication1.Visible[0] := True; ExcelApplication1.Disconnect; end; end;
A app2001 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #3 一个插入图片的例子你看看 procedure TForm1.Button1Click(Sender: TObject); var aWorkBook : _Workbook; aSheet : Variant; begin if OpenPictureDialog1.Execute then begin ExcelApplication1.Connect; aWorkBook := ExcelApplication1.Workbooks.Add(EmptyParam, 0); aSheet := aWorkBook.Sheets[1]; aSheet.Range['f1'].Select;//这里是定位图片插入的位置 asheet.Pictures.Insert(OpenPictureDialog1.FileName); ExcelApplication1.Visible[0] := True; ExcelApplication1.Disconnect; end; end;
一个插入图片的例子你看看 procedure TForm1.Button1Click(Sender: TObject); var aWorkBook : _Workbook; aSheet : Variant; begin if OpenPictureDialog1.Execute then begin ExcelApplication1.Connect; aWorkBook := ExcelApplication1.Workbooks.Add(EmptyParam, 0); aSheet := aWorkBook.Sheets[1]; aSheet.Range['f1'].Select;//这里是定位图片插入的位置 asheet.Pictures.Insert(OpenPictureDialog1.FileName); ExcelApplication1.Visible[0] := True; ExcelApplication1.Disconnect; end; end;
H hots Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #4 http://delphibbs.com/keylife/iblog_show.asp?xid=5715 不要忘了给分
L lmz123 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #5 定义好Sheet后,使用ExcelWorkSheet1.Shapes.AddPicture(文件名,颜色值,颜色值,top,left,width,height)
F fwpjob Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-03 #6 谢谢各位的支持,欢迎下次再来赚我的分!虽然我穷了点。