Autor Beitrag
Flamefire
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Mo 02.07.07 06:16 
Wie kann ich excel steuern?
Also z.b.:
-Rahmen machen
-Farbe der Zellen ändern
...

Gibts da ein TUT?

2. Frage: Wie kann ich eine Tabelle auf eine 2. Seite machen?
Hab also eine Excel Tabelle mit Cells[x,y] usw. erstellt und möchte die jetzt einmal auf Seite 1 und auf Seite 2 ganz oben jeweils (werden dann verschiedene Tabellen)
Das Problem ist also:Wo ist die 2.Seite?
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Mo 02.07.07 07:40 
Oleee ole ole oleeee.. wir haben "OLE" olee :rofl: :party:

www.dsdt.info/tutorials/automation/?page=4

;)

_________________
<(^^<) <(^^)> (>^^)>
===================
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mo 02.07.07 08:05 
In der MSDN-Library sollte das OLE-Interface eigentlich komplett dokumentiert sein.

Du kannst allerdings auch Excel-Dateien bearbeiten ohne auf Excel angewiesen zu sein und damit auch Versionskonflikten aus dem Weg gehen. Ein kostenloser, passabler Weg sind die Flexcel-Komponenten, für knapp 50$ gehts noch besser mit NativeExcel. Gibts beides bei Torry.

_________________
Bravery calls my name in the sound of the wind in the night...
Flamefire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Mo 02.07.07 10:25 
hmm...da sind nur datenübergabe drin
wie mach ich den rest?
-Farbe
-Rahmen
-Schriftart
-Zellgröße
Agawain
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 460

win xp
D5, MySQL, devxpress
BeitragVerfasst: Mo 02.07.07 10:48 
Hi

Zeichne Dir ein Macro auf, dann hast Du die entsprechenden Befehle.

Gruß

Aga
Flamefire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Mo 02.07.07 20:06 
Macro?
hmm ich will das Programm ja auf anderen Rechnern laufen lassen, die nicht mir gehören. Kann von meinen Bekannten ja nicht erwarten, dass die erst mal n Macro drauf haun.

Hab aber schon Teile behoben. Verbleibend:

-Rahmen
-2. Seite
-Zellgröße
Agawain
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 460

win xp
D5, MySQL, devxpress
BeitragVerfasst: Di 03.07.07 16:25 
Ne so meinte ich das nicht.

Du kannst Dir die Befehle aus Excel holen, indem Du ein Macro aufzeichnest.
Dann hast Du schon die Syntax für Deinen Delphi-Code.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
   Excel := CreateOleObject('Excel.Application');
     Excel.Workbooks.Open('\\gehteuchnixan\Import.xls');
     Excel.Sheets[1].cells[3,6].Select;
     Excel.Selection.Autofilter(Field := 6, Criteria1 := '<>');
     Bereich := Excel.Sheets[1].Autofilter.Range.Address;
     Excel.Sheets[1].cells[1,1].Value := Bereich;
     B := Excel.Sheets[1].Autofilter.Range;
     Excel.Sheets[1].cells[1,2].Value := B.cells.Count;
     Excel.CutCopyMode := False;
     B.Select;
     Excel.Selection.Copy;
     Excel.Sheets.Add;
    // Excel.Sheets[1].cells(1,1).Select;
     Excel.ActiveSheet.Paste;
     Excel.Selection.cells[1, 1].Value := Excel.Selection.Rows.Count;


um diesen Quelltext zu erstellen, hab ich mir in excel ein Makro gemacht und dann angepaßt in meinen Quellcode reinkopiert.
Im wesentlichen genügt es, den erzeugten Code auf die Delphi-Interpunktion anzupassen und ggfs. ein paar geschwätzige Zeilen rauszuschmeißen.

Gruß

Aga
Flamefire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Mi 04.07.07 05:58 
ok danke...das reicht ^^
jz hab ichs