Re : Macro pour lien hypertexte
Bonjour à tous, mromain,
Je suis passé sous office 2013 et depuis le code que tu m'a fourni ne fonctionne plus, où du moins l'application ne reconnait plus l'objet (?) "Format".
Private Sub ListFilesInt(pathFolder As String, checkSubFolder As Boolean, ByRef result() As String, ByRef iFile As Long)
Static myFso As Object
Dim fold As Object, curFile As Object, curFold As Object, tabStr() As String, ext As String
If myFso Is Nothing Then Set myFso = CreateObject("Scripting.FileSystemObject")
If Not myFso.FolderExists(pathFolder) Then Exit Sub
Set fold = myFso.GetFolder(pathFolder)
For Each curFile In fold.Files
tabStr = Split(curFile.Name, ".")
ext = tabStr(UBound(tabStr))
iFile = iFile + 1: ReDim Preserve result(1 To 7, 1 To iFile)
result(1, iFile) = curFile.Path
result(2, iFile) = curFile.Name
result(3, iFile) = Replace(curFile.Name, "." & ext, vbNullString)
result(4, iFile) = ext
result(5, iFile) = fold.Path
result(6, iFile) = Format(curFile.DateCreated, "yyyy.mm.dd")
result(7, iFile) = Format(curFile.DateLastModified, "yyyy.mm.dd")
Next curFile
If Not checkSubFolder Then Exit Sub
For Each curFold In fold.SubFolders
ListFilesInt curFold.Path, True, result, iFile
Next curFold
End Sub
Comment dois-je résoudre cela?
Merci par avance du coup de main