Excel avec delphi :)

TheShAmAn Messages postés 148 Date d'inscription lundi 3 février 2003 Statut Membre Dernière intervention 1 février 2006 - 7 juin 2004 à 12:20
hesnogood Messages postés 10 Date d'inscription lundi 10 janvier 2005 Statut Membre Dernière intervention 30 juillet 2007 - 25 oct. 2005 à 15:29
Bon g un tout petit pb, mais ca me saoule de po trouver... :(

Bon j'arrive a manipuler le format des cellules Excel, sauf pour une chose :
=>>> Centrer les donnée d'une cellule :dissapprove)

Dc voila, si kelk1 c, ca serait cool de me le dire ;)

merki d'avance :big)

7 réponses

cs_Kenavo Messages postés 702 Date d'inscription vendredi 21 mars 2003 Statut Membre Dernière intervention 1 octobre 2009 5
7 juin 2004 à 14:53
Salut,
J'ai ça pour le pilotage d'Excel par macro via DDE

ALIGNMENT
Macro Sheets Only
Equivalent to choosing the Alignment tab in the Format Cells dialog box, which is displayed when you choose the Cells command from the Format menu. Aligns the contents of the selected cells.

Syntax

ALIGNMENT(horiz_align, wrap, vert_align, orientation, add_indent)
ALIGNMENT?(horiz_align, wrap, vert_align, orientation, add_indent)

Horiz_align    is a number from 1 to 7 specifying the type of horizontal alignment, as shown in the following table. If horiz_align is omitted, horizontal alignment does not change.

Horiz_align	Horizontal alignment

1	General
2	Left
3	Center
4	Right
5	Fill
6	Justify
7	Center across selection

Wrap    is a logical value corresponding to the Wrap Text check box in the Alignment tab. If wrap is TRUE, Microsoft Excel selects the check box and wraps text in cells; if FALSE, Microsoft Excel clears the check box and does not wrap text. If wrap is omitted, wrapping does not change.

Vert_align    is a number from 1 to 4 specifying the vertical alignment of the text. If vert_align is omitted, vertical alignment does not change.

Vert_align	Vertical alignment

1	Top 
2	Center 
3	Bottom
4	Justify

Orientation    is a number from 0 to 4 specifying the orientation of the text. If orientation is omitted, text orientation does not change.

Orientation	Text orientation

0	Horizontal
1	Vertical 
2	Upward
3	Downward
4	Automatic (applies to only chart tick labels)
Add_indent	This argument is for only Far East versions of Microsoft Excel.


C'est extrait de l'aide sur les macros Excel 97 XLMACR8.HLP

Macro97.exe

Ken@vo
____________________
Code, Code, Codec !
0
TheShAmAn Messages postés 148 Date d'inscription lundi 3 février 2003 Statut Membre Dernière intervention 1 février 2006
9 juin 2004 à 11:37
Moi c ce ke g trouve... mais ca merde... :sad)
Excel.XLFeuille.range['A1', 'B2'].Font.HorizontalAlignment:=xlCenter;


Vu ke pr les mises en formes c:
Ex pr mettre en gras
Excel.XLFeuille.range['A2','R3'].Font.Bold:=True;


Alors voila si kel1 vois, merki d'avance ^^
0
cs_Kenavo Messages postés 702 Date d'inscription vendredi 21 mars 2003 Statut Membre Dernière intervention 1 octobre 2009 5
9 juin 2004 à 12:10
Ah ben oui ! C'est pas du tout ce que j'utilise comme composant !
Mais pourquoi Font.HorizotalAlignment et pas HorizotalAlignment tout court ? C'est la cellule qu'on aligne pas la font. Bon courage

Ken@vo
____________________
Code, Code, Codec !
0
TheShAmAn Messages postés 148 Date d'inscription lundi 3 février 2003 Statut Membre Dernière intervention 1 février 2006
9 juin 2004 à 16:23
lol MDR :big)
Tu as eu raison... comment g ete trop con la dessus :dissapprove)

Enfin merci a toi... ;)
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_Kenavo Messages postés 702 Date d'inscription vendredi 21 mars 2003 Statut Membre Dernière intervention 1 octobre 2009 5
9 juin 2004 à 16:33
Allez, c'était juste un petit coup de fatigue !
Dis donc, c'est quoi que tu utilises comme composant ?
C'est un truc inclus ou téléchargé ?
A+
Ken@vo
____________________
Code, Code, Codec !
0
TheShAmAn Messages postés 148 Date d'inscription lundi 3 février 2003 Statut Membre Dernière intervention 1 février 2006
10 juin 2004 à 10:42
non non :big)
C tt de ma composition :big) huhu!!

Si tu veux...
var Excel : TExcelObj;

Et TExcelObj, bah c une unite ke g créé, on y retrouve dedans des procedures tels que :
-> ouverture et fermetures d'un fichier excel
-> Sélection d'un feuille
-> Extraction des données d'une cellule
-> Copier de données ds une cellule
-> etc... :)

Sinon pr info:
uses SysUtils, Classes, Qforms, ComObj, Variants, QDialogs, ShellAPI, Windows;

Voila ;)
0
hesnogood Messages postés 10 Date d'inscription lundi 10 janvier 2005 Statut Membre Dernière intervention 30 juillet 2007
25 oct. 2005 à 15:29
alors c'est koi la syntaxe exacte pour aligner les texte dans une colonne Excel .. Merci
0
Rejoignez-nous