I
iv6.0
Unregistered / Unconfirmed
GUEST, unregistred user!
delphi中我是用CreateOleObject来操作excel的,我想把sheet1 的A1,联接到sheet2,sheet1 的A2联接到sheet3,如何做??
我在宏中是这样的,怎么转换为delphi呢??
Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Sheet2!A1", TextToDisplay:="qqqq"
还有,最好不好用控件的方法,CreateOleObject来操作excel,有什么帮助吗??
var
ExcelObj, Excel, WorkBook, Sheet: OleVariant;
begin
ExcelObj := CreateOleObject('Excel.Sheet');
Excel := ExcelObj.Application;
Excel.Visible := true ;
WorkBook := Excel.Workbooks.add ;
Sheet:= WorkBook.Sheets.add;
Sheet.Name:='系统总表';
sheet.range['A1'].select;
//sheet.Hyperlinks.Add(' Anchor:=Selection', 'Address:=''''','SubAddress:=' +WorkBook.Sheets[2].name);
Sheet.Hyperlinks.Add [' Anchor:=Selection', 'Address:=''''','SubAddress:=''Sheet2!A1'''];
end;
不成功,请高手指教
我在宏中是这样的,怎么转换为delphi呢??
Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Sheet2!A1", TextToDisplay:="qqqq"
还有,最好不好用控件的方法,CreateOleObject来操作excel,有什么帮助吗??
var
ExcelObj, Excel, WorkBook, Sheet: OleVariant;
begin
ExcelObj := CreateOleObject('Excel.Sheet');
Excel := ExcelObj.Application;
Excel.Visible := true ;
WorkBook := Excel.Workbooks.add ;
Sheet:= WorkBook.Sheets.add;
Sheet.Name:='系统总表';
sheet.range['A1'].select;
//sheet.Hyperlinks.Add(' Anchor:=Selection', 'Address:=''''','SubAddress:=' +WorkBook.Sheets[2].name);
Sheet.Hyperlinks.Add [' Anchor:=Selection', 'Address:=''''','SubAddress:=''Sheet2!A1'''];
end;
不成功,请高手指教