Einzelnen Beitrag anzeigen

Benutzerbild von Chemiker
Chemiker

Registriert seit: 14. Aug 2005
1.858 Beiträge
 
Delphi 11 Alexandria
 
#12

AW: Delphi 2010 Professional & Excel 2007 TypeLibrary Probleme

  Alt 13. Nov 2011, 18:38
Hallo Cyberaxx,
versuch mal das hier:

Delphi-Quellcode:
procedure TForm1.btnRahmenZeichnenClick(Sender: TObject);
var
  OLEvExcel: OleVariant;
begin
  OLEvExcel := CreateOleObject('Excel.Application');
  OLEvExcel.Visible:= TRUE;
  OLEvExcel.Workbooks.add;
  OLEvExcel.ActiveWorkbook.Worksheets['Tabelle1'];

  OLEvExcel.Range['A1:L3'].Select;
  OLEvExcel.Selection.Borders[xlDiagonalDown].LineStyle := xlNone;
  OLEvExcel.Selection.Borders[xlDiagonalUp].LineStyle := xlNone;
  OLEvExcel.Selection.Borders[xlEdgeLeft].LineStyle := xlNone;

  OLEvExcel.Selection.Borders[xlEdgeTop].LineStyle := xlContinuous;
  OLEvExcel.Selection.Borders[xlEdgeTop].Color := -16777024;
  OLEvExcel.Selection.Borders[xlEdgeTop].TintAndShade := 0;
  OLEvExcel.Selection.Borders[xlEdgeTop].Weight := xlThin;

  ShowMessage('Rahmen in Excel ansehen');

  OLEvExcel.ActiveWorkBook.Saved:= TRUE;
  OLEvExcel.Workbooks.Close;

  OLEvExcel.Quit;
  OLEvExcel:= Unassigned;
end;


Bis bald Chemiker
wer gesund ist hat 1000 wünsche wer krank ist nur einen.
  Mit Zitat antworten Zitat