Bonjour,
Voila, je cherche a encadrer une cellule en gras (double ligne) par mon soft.
Je suis aller sur la FAQ et l'ai trouvé ceci :
Ca ne fonctionne pas. Je suis sous excel 2002.
Code : Sélectionner tout - Visualiser dans une fenêtre à part MaFeuille.Range['A1','C5'].BorderAround(xlDouble,xlThin,6,EmptyParam);
Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 procedure TForm2.TerminerClick(Sender: TObject); var XLApp : Variant; NbLigne,x,y, tampon : integer; titre, essai : string; begin titre :=''; essai := 'A1'; x:= 0; y:= 0; if MessageDlg('Confirmez vous le transfert de vos champs vers Excel ?', mtConfirmation, [mbOK,mbCancel],0) = mrOK then begin try XLApp := CreateOleObject ('Excel.Application'); except ShowMessage ('Démarrage de Excel impossible'); exit; end; XLApp.Visible := true; XLApp.Workbooks.add ; if TitreFusionCellule.Checked then begin XLApp.Range[essai,'E1'].Merge(False); // fusionner les cellules XLApp.Selection.horizontalalignment:=-4108; // Mettre l'alignement au centre (gauche=-4131 droite=-4152) end; if ValeurTitreCaractere.Text <> '' then begin Tampon := StrToInt (ValeurTitreCaractere.Text); XLApp.Range['A1','A1'].Font.Size := tampon; end else titreHauteur.Checked := false; { MaFeuille.Range['A1','C5'].Font.Name:='times new roman'; MaFeuille.Range['A1','C5'].Font.Size:=14; MaFeuille.Range['A1','C5'].Font.Bold:=True; } if ValeurTitre.Text <> '' then begin ValeurTitre.Text := upperCase (ValeurTitre.Text); XLApp.Cells[1.1].Value := ValeurTitre.Text; end else TitreTab.Checked := false; XLApp.Cells[1.2].Value := ValeurTitre.Text;// pour essai XLApp.Range['A1','B1'].BorderAround(xlDouble,xlThin,6,EmptyParam); // ici ca plante
et voici l'entete
Si quelqu'un à des indices...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DBCtrls, DB, DBGrids, DBTables, Grids, ExtCtrls, StdCtrls, ComCtrls, Buttons, ComObj, CheckLst; type TForm2 = class(TForm) FeuilleMatch: TButton; CheckListBox1: TCheckListBox; Label1: TLabel; Label2: TLabel; Shape1: TShape; Label3: TLabel; TitreTab: TCheckBox; TitreEncadrer: TCheckBox; titreHauteur: TCheckBox; TitreTraitDouble: TCheckBox; ValeurTitreCaractere: TEdit; ValeurTitre: TEdit; TitreFusionCellule: TCheckBox; ChampHauteur: TCheckBox; EncadreInterne: TCheckBox; EncadreExterne: TCheckBox; ChampHauteurValeur: TEdit; ChampNomHauteur: TCheckBox; ChampNomHauteurValeur: TEdit; Label5: TLabel; Label6: TLabel; Shape3: TShape; Shape4: TShape; Shape5: TShape; Terminer: TButton; Memo1: TMemo; procedure CheckListBox1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure TerminerClick(Sender: TObject); procedure TitreTabClick(Sender: TObject); procedure titreHauteurClick(Sender: TObject); procedure TitreEncadrerClick(Sender: TObject);
Merci beaucoup pour votre aide
elecpic
Partager