Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 01.06.05 21:14 
Hi, Delpher,

wie ich ein Stringgrid in eine Excel-Tabelle pumpe, weiß ich, die optimale Spaltenbreite bekomme ich mit appl.columns.autofit;

Aber wie kann ich Excel so ansprechen, dass die erste Zeile (Tabellenkopf)
farbig (in Excel) dargestellt wird? Habe schon hefig gesucht, aber noch ohne Erfolg...

Wer weiß da Rat? :shock:

Danke für Hilfe,
Detlef Annies
nelle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 02.06.05 08:45 
Einer der Tricks, die ich für so etwas verwende ist:
Die Aktionen von Hand ausführen und sie vom Makro-Rekorder aufzeichnen lassen.
Den entstandenen VBA-Code in's Delphi übersetzen...

Nelle
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 02.06.05 21:54 
Hi, nelle,
das war ein guter Tipp, zwar habe ich nicht mit dem Makrorecorder gearbeitet, aber ich habe einen VB-Code nach Delphi adaptiert, was so ziemlich das gleiche ist...

Der Code ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var appl : _application;

...

with appl.range['A1','A30'] do 
  begin font.bold := true; font.color := clgreen; end;



Viele Grüße,
D. Annies

Moderiert von user profile iconraziel: Delphi-Tags repariert.