cs_ITALIA
Messages postés2169Date d'inscriptionvendredi 20 avril 2001StatutMembreDernière intervention30 juin 2009
-
Modifié le 10 janv. 2005 à 09:18
cs_ITALIA
Messages postés2169Date d'inscriptionvendredi 20 avril 2001StatutMembreDernière intervention30 juin 2009
-
10 janv. 2005 à 09:18
Salut, tous le monde,
J'utilise cette fonction pour extraire les données d'un MsFlexGrid vers Excel...
ça Fonctionne bien sauf pour les dates...
en les ecrivant dans excel il m'inverse parfois les jour et les mois.......
Comment ca se fait ? Avez vous une fonction à me proposer ? ou des Corrections ?
Merci d'avance
Public Sub FlexGrid_To_Excel(TheFlexgrid As MSFlexGrid,TheRows As Integer, TheCols As Integer, Optional GridStyle As Integer = 1, Optional WorkSheetName As String)
Dim objXL As New Excel.Application
Dim wbXL As New Excel.Workbook
Dim wsXL As New Excel.Worksheet
Dim intRow As Integer ' counter
Dim intCol As Integer ' counter
If Not IsObject(objXL) Then
MsgBox "Vous Avez Besoin d' Excel",vbExclamation, "Envoie dans Excel"
Exit Sub
End If
On Error Resume Next
ObjXL.Visible = True
Set wbXL = objXL.Workbooks.Add
Set wsXL = objXL.ActiveSheet
With wsXL
If Not WorkSheetName = "" Then
.Name = WorkSheetName
End If
End With
For intRow = 1 To TheRows
For intCol = 1 To TheCols
With TheFlexgrid
wsXL.Cells(intRow, intCol).Value = _
.TextMatrix(intRow - 1, intCol - 1) & " "
End With
Next
Next
End Sub