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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
Option Explicit
Private strPathCsv As String
Private strPathJob As String
Public strPathJobIN As String
Public strPathJobOUT As String
Public strPathTemp As String
Public strPathTempIN As String
Public strPathTempOUT As String
Private Sub CheckBox1_Click()
End Sub
Private Sub CmdBrowseJobDirectory_Click()
'Récupération du chemin de travail
'MsgBox SelectFolder("Sélectionnez un répertoire :", 0)
strPathJob = SelectFolder("Sélectionnez un répertoire :", 0)
' Permet de modifier la valeur Text du champ de texte.
txtPathJobDirectory.text = strPathJob 'indique le chemin complet
txtPathJobDirectory.BackColor = &H80000005 'change la couleur du label
'lbltxtPathExcelFile.Caption = ""
'initialisation des variables pour les chemins de transfert de fichier
strPathJobIN = strPathJob & "\IN\"
MsgBox strPathJobIN
strPathJobOUT = strPathJob & "\OUT\"
MsgBox strPathJobOUT
'===========================================================================
' lecture du fichier
Dim L As String
Dim i As Long
Dim Datas() As String
'anciens nom de fichiers
Dim tableauNEW() As String
'nouveaux nom de fichiers
Dim tableauOLD() As String
i = 0
Open txtPathExcelFile.text For Input As #1
While Not EOF(1)
Line Input #1, L
Datas = Split(L, ";")
tableauOLD(i) = Datas(0)
'MsgBox Datas(0)
tableauNEW(i) = Datas(1)
'MsgBox Datas(1)
i = i + 1
' copie les fichiers sur le disque local
For i = 0 To tableauOLD.Lenght - 1
FileCopy strPathJobIN & i & "*", strPathTempIN
Next i
Wend
Close #1
'filecopy (
'Next i
Exit Sub
End Sub
Private Sub CommandButton2_Click()
End Sub
Private Sub CatDuavBox_Click()
Call catDuavOption
End Sub
Private Sub ExcelFileSelectButton1_Click()
' Choix du répertoire de diffusion
Dim strResultOpenFile As String
strResultOpenFile = ShowOpenFileDialog("Xls File (*.xls)|*.xls", "", "", OFN_NOCHANGEDIR)
'txtRepertoire.text = strResultOpenFile
' Mise à jour de la variable globale
'eXls.Main = strResultOpenFile
End Sub
Private Sub INOUTSelectDirectory_Click()
Call SystemDirectory
End Sub
Private Sub Help_Click()
End Sub
Private Sub QCheckBox2_Click()
End Sub
Private Sub CommandButton1_Click()
' initialisation des chemins locaux manuellement
strPathTemp = "c:\temp"
strPathTempIN = strPathTemp & "\IN\"
strPathTempOUT = strPathTemp & "\OUT\"
MsgBox "Please see if " & strPathTempIN & " " & "is created on your PC", vbCritical, "Caution !"
MsgBox "Please see if " & strPathTempOUT & " " & "is created on your PC", vbCritical, "Caution !"
End Sub
Private Sub CmdBrowseCvsFile_Click()
On Error GoTo ErrorFile
winCmd.CancelError = True
winCmd.InitDir = "c:\"
winCmd.Filter = "Csv File (.csv)|*.csv"
winCmd.FilterIndex = 1
winCmd.Action = 1
winCmd.ShowOpen
strPathCsv = winCmd.FileName
' Permet de modifier la valeur Text du champ de texte.
txtPathExcelFile.text = strPathCsv 'indique le chemin complet
txtPathExcelFile.BackColor = &H80000005 'change la couleur du label
'lbltxtPathExcelFile.Caption = ""
'*****************************************
ErrorFile:
End Sub
Private Sub cmddExitButton_Click()
Unload Me
End
End Sub
Private Sub cmdHelp_Click()
Call HelpMessage
End Sub
Private Sub CmdReadOnlyButton_Click()
Call passerClasseur_lectureSeule
MsgBox "Excel file's protected now!", vbInformation, "Lock Excel File"
End Sub
Private Sub CmdStart_Click()
'copie les fichiers sources vers temporaire IN
Call CopyFile
MsgBox "Data processed successfully", vbInformation, "Congratulations !"
End Sub
Private Sub ProgressBar2_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As stdole.OLE_XPOS_PIXELS, ByVal y As stdole.OLE_YPOS_PIXELS)
End Sub
Private Sub txtPathExcelFile_Change()
' Dim path As String
' path = BrowseDir(Me.hWnd, "Please select CSV File (.csv) ")
' If (path <> "") Then
' edtPath = path
' End If
End Sub
Private Sub txtPathJobDirectory_Change()
End Sub |
Partager