我想把编缉栏里的数据﹐如edit1.text 里的内容﹐导出到excel里﹐我用了好几种方法﹐却都是错的﹐
如 Procedure editToExcel(ExcelCaption:String;);
var
ExcelApp:OleVariant;
begin
ExcelApp := CreateOleObject('Excel.Application');
ExcelApp.Caption := ExcelCaption;
ExcelApp.WorkBooks.Add;
ExcelApp.WorkSheets[1].Activate;
ExcelApp.Visible := True;
ExcelApp.Cells[1,1].Value := edit1.text
ExcelApp.Cells[1,2].Value := edit2.text.......
end;
end;
各位大哥﹐小姐﹐帮我呀~~在下不胜感激
如 Procedure editToExcel(ExcelCaption:String;);
var
ExcelApp:OleVariant;
begin
ExcelApp := CreateOleObject('Excel.Application');
ExcelApp.Caption := ExcelCaption;
ExcelApp.WorkBooks.Add;
ExcelApp.WorkSheets[1].Activate;
ExcelApp.Visible := True;
ExcelApp.Cells[1,1].Value := edit1.text
ExcelApp.Cells[1,2].Value := edit2.text.......
end;
end;
各位大哥﹐小姐﹐帮我呀~~在下不胜感激
xlworkbook:varinat;
xlworksheet:variant; xlapp:=CreateOleObject('Excel.application');
XlApp.Visible:=False;
xlWorkBook:=xlApp.Workbooks.Add(-4167);
xlWorkSheet:=xlapp.WorkBooks[1].Worksheets['sheet1']
xlWorkSheet.cells[1,1]:=edit1.text;
xlapp.visisble:=True;
我于你的寫法﹐
出現如下錯誤提示~~
method visisble' not supported by automation object
請問還要加什么控制對像嗎﹖
XlApp.Visible:=False;