M myjane Unregistered / Unconfirmed GUEST, unregistred user! 2007-04-26 #1 在DELPHI里如何把数据传给EXCEL里的Sheet1的A1,A2,再把A3,A4返回到DELPHI? 要在不打开EXCEL的情况下进行!!!!
W wzquan Unregistered / Unconfirmed GUEST, unregistred user! 2007-04-27 #2 把excel当作一个数据库打开就可以了。搜一下ado打开excel数据库的例子,代码有的是
K kaida Unregistered / Unconfirmed GUEST, unregistred user! 2007-04-27 #3 var ExcelApp,MyWorkBook,mysheet:Variant; begin ExcelApp:=CreateOleObject('Excel.Application'); MyWorkBook:=CreateOleobject('Excel.Sheet'); MyWorkBook.WorkSheets[1].Cells[1,1].Value := 'your String1'; MyWorkBook.WorkSheets[1].Cells[1,2].Value := 'your String2'; .......
var ExcelApp,MyWorkBook,mysheet:Variant; begin ExcelApp:=CreateOleObject('Excel.Application'); MyWorkBook:=CreateOleobject('Excel.Sheet'); MyWorkBook.WorkSheets[1].Cells[1,1].Value := 'your String1'; MyWorkBook.WorkSheets[1].Cells[1,2].Value := 'your String2'; .......