Sub aSmpLine()
Sheet1.Shapes.AddLine(100, 100, 180, 150).Name = "Line1"
With [line1].ShapeRange.Line
.Weight = 3
.DashStyle = msoLineSolid
.Style = msoLineThinThin
.Visible = True
.ForeColor.SchemeColor = 10
.BackColor.RGB = RGB(255, 255, 255)
.EndArrowheadStyle = msoArrowheadTriangle
.EndArrowheadLength = msoArrowheadLengthMedium
.EndArrowheadWidth = msoArrowheadWidthMedium
End With
MsgBox "Will deleted!"
[line1].Delete
End Sub请帮忙将以上EXCEL的VBA语句翻译成Delphi语句,急用,谢谢!
Sheet1.Shapes.AddLine(100, 100, 180, 150).Name = "Line1"
With [line1].ShapeRange.Line
.Weight = 3
.DashStyle = msoLineSolid
.Style = msoLineThinThin
.Visible = True
.ForeColor.SchemeColor = 10
.BackColor.RGB = RGB(255, 255, 255)
.EndArrowheadStyle = msoArrowheadTriangle
.EndArrowheadLength = msoArrowheadLengthMedium
.EndArrowheadWidth = msoArrowheadWidthMedium
End With
MsgBox "Will deleted!"
[line1].Delete
End Sub请帮忙将以上EXCEL的VBA语句翻译成Delphi语句,急用,谢谢!
参考代码:
uses Comobj;
var
vExcelApp: Variant;
begin
vExcelApp := CreateOleObject('Excel.Application');
// 显示Excel界面
vExcelApp.Visible := true;
// 添加一个工作簿
vExcelApp.Workbooks.Add;
// 添加一直线
vExcelApp.ActiveSheet.Shapes.AddLine(186.75, 105.75, 323.25, 154.5).Select;
vExcelApp.Selection.ShapeRange.Flip(1); // msoFlipVertical
// 添加一箭头
vExcelApp.ActiveSheet.Shapes.AddLine(227.25, 177.75, 342.75, 225).Select;
vExcelApp.Selection.ShapeRange.Line.EndArrowheadStyle := 2; // msoArrowheadTriangle
vExcelApp.Selection.ShapeRange.Line.EndArrowheadLength := 2; // msoArrowheadLengthMedium
vExcelApp.Selection.ShapeRange.Line.EndArrowheadWidth := 2; // msoArrowheadWidthMedium
vExcelApp.Selection.ShapeRange.Flip(1); // msoFlipVertical;
// 添加一双箭头
vExcelApp.ActiveSheet.Shapes.AddLine(265.5, 231, 405, 297.75).Select;
vExcelApp.Selection.ShapeRange.Line.BeginArrowheadStyle := 2; // msoArrowheadTriangle;
vExcelApp.Selection.ShapeRange.Line.BeginArrowheadLength := 2; // msoArrowheadLengthMedium;
vExcelApp.Selection.ShapeRange.Line.BeginArrowheadWidth := 2; // msoArrowheadWidthMedium;
vExcelApp.Selection.ShapeRange.Line.EndArrowheadStyle := 2; // msoArrowheadTriangle;
vExcelApp.Selection.ShapeRange.Line.EndArrowheadLength := 2; // msoArrowheadLengthMedium;
vExcelApp.Selection.ShapeRange.Line.EndArrowheadWidth := 2; // msoArrowheadWidthMedium;
vExcelApp.Selection.ShapeRange.Flip(1); // msoFlipVertical
//...
end;