rt

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      try
        begin
          try
            ExcelApplication1.Connect;
          except
            ShowMessage('Connect excel error');
            Exit;
          end;
          ExcelApplication1.Visible[0]:=True;
        end;
      except
        on E:Exception do
        begin
          Application.ShowException(E);
          ExcelApplication1.Disconnect;
        end;
      end;
    end;