1.在EXCEL中画一条线是这样的:
   excelworksheet1.Shapes.AddLine(x1,y1,x2,y2);如何得到行数和列数与数值()对应的关系?
比如说我怎么知道第三行,第一列的交叉点的X,Y值?2.在画线后,如何设置线型和颜色?

解决方案 »

  1.   

    procedure TReport_Area_Frm.S_deleteClick(Sender: TObject);
    var
    filename:string;
    xl,ExcelApp,WorkBook,Sheet: oleVariant;
    x,y:integer;
    begin
      inherited;
      OpenDialog1.InitialDir:=ExtractFilePath(Application.ExeName)+'报表管理';
      OpenDialog1.Execute;
      filename:=OpenDialog1.FileName;
      if length(filename)=0 then
      begin
         Mymessagebox('  没有选择历史统计文件的存储位置,不能导入历史统计文件的数 !  ',1,2);
         exit;
      end;
      try
            ExcelApp := CreateOleObject('Excel.Application');
            WorkBook:=CreateOleobject('Excel.Sheet');
            ExcelApp.WorkBooks.Open(filename);
            ExcelApp.WorkSheets[1].Activate;
      except
            Mymessagebox('  您的机器里未安装Microsoft Excel没有该文件,不能导入Excel报表! ',1,2);
            exit;
      end;
      if ExcelApp.Cells[1,1].Value='各地区流量报表' then
      begin
        label1.Caption:=ExcelApp.Cells[2,1].Value;
        sa_grid.RowCount:=17;
        for y:=1 to sa_grid.RowCount-1 do
        begin
          for x:=1 to 5 do
          begin
              sa_grid.Cells[x,y]:=ExcelApp.Cells[y+3,x].Value;
          end;
        end;
      end else begin
            Mymessagebox('  该Excel文件不是本系统导出的统计文件,不能导入本系统! ',1,2);
            exit;
      end;
      WorkBook.Close;
      ExcelApp.Quit;
    不知道对你有用否!!!!
      

  2.   

    感谢楼上各位朋友
    呵呵
    TO :ld9702(ld) 我的题目可不是这个呀,这个很久以前就实现了的