Bonjour à tous,
Je viens juste de passer en VB.NET et je cherche à utiliser la fonction
tri de excel à travers mon programme mais VB me souligne "Range,
xlAscending, xlGuess, xlTopToBottom ect..." J'ai vu sur le forum qu'il
était possible d'utiliser cette fonction pouvez vous me dire ce qui ne
vas pas dans mon programme afin que celui-ci marche.
Merci d'avance
Caussenard
Private Sub DeterminationLotsLocalisations_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DeterminationLotsLocalisations.Click
Dim SylphApp As Object
Dim SylphWkbMachine As Object
Dim SylphWksMachine As Object
Dim FileName As String
Dim PRISE As String
Dim Ligne As String
Ligne = 1
'Ouverture du fichier MACHINE
SylphApp = CreateObject("Excel.Application")
SylphApp.DisplayAlerts = False
SylphApp.EnableEvents = False
SylphApp.Visible = True
FileName = CF.GetCAProjet & "FM_" & CF.NomProjet & ".xls"
SylphWkbMachine = SylphApp.Workbooks.Open(FileName)
SylphWksMachine = SylphWkbMachine.sheets("Feuil1")
'Suppression des colonnes inutiles
SylphWksMachine.Columns("B:H").Delete()
SylphWksMachine.Columns("C:BE").Delete()
Ect.........
'Classement des Prises par leur noms
SylphWksMachine.Range("A2:B5000").Sort(Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range _
("B2"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal)
'Enregistrement du fichier Machine
FileName = CF.GetCALoc & "Loc" & CF.NomProjet & ".xls"
SylphWkbMachine.Saveas(FileName)
SylphWkbMachine.Close(False)
SylphApp.quit()
End Sub
Caussenard