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
| MonClasseur est un objet Automation dynamique
MaFeuille est un objet Automation dynamique
// Instance de Excel existante ?
SI ObjetActif("Excel.Application") <> Null ALORS
// Récupération de l'instance de Excel existante
MonClasseur = ObjetActif("Excel.Application")
SINON
// Allocation de l'objet automation "MonClasseur"
MonClasseur = allouer un objet Automation "Excel.Application"
FIN
SI MonClasseur = Null ALORS
Erreur("Impossible de lancer Excel.")
RETOUR
FIN
// Excel est visible
MonClasseur>>Visible = True
MonClasseur>>workbooks>>Open("F:\temp\monclasseur1.xls") // ouvre le classeur
// MonClasseur>>Worksheets("Personnes")>>Sort>>SortFields>>Clear plantage ici
MaFeuille = MonClasseur>>Worksheets("Personnes")
// expression .Sort(Key1, Order1, Key2, Type, Order2, Key3, Order3, Header, OrderCustom, MatchCase, Orientation, SortMethod, DataOption1, DataOption2, DataOption3)
MaFeuille>>Range("A1:C23")>>Sort(MaFeuille>>Range("A1:A23"),xlAscending,"",MaFeuille>>Range("B1:B23"),xlAscending,...
MaFeuille>>Range("C1:C23"),xlAscending,xlNo,1,OLEFaux,xlSortColumns,xlPinYin,xlSortTextAsNumbers)
//
// placer code ici pour traitements suivants
//
MonClasseur>>activeworkbook>>Close(OLEFaux)
MonClasseur>>Quit() |
Partager