ich habe folgendes Problem:
ich möchte in einer Listbox alle Dateinamen aus dem DownloadOrdner anzeigen, die in der letzten halben Stunde heruntergeladen wurde.
Ich habe irgendwie gar keine Ahnung wie ich da ansetzten soll.
Vielen Dank schonmal
Sigi
Private Sub UserForm_Activate()
Dim strPath As String, strFile As String
Dim lngIndex As Long
Const cdblFileAge As Double = 1 / 48 'halbe Stunde
strPath = Environ("USERPROFILE") & "\Downloads\"
strFile = Dir(strPath & "*", vbNormal)
Do While strFile <> ""
If FileDateTime(strPath & strFile) >= (Now - cdblFileAge) Then ListBox1.AddItem strFile
strFile = Dir
Loop
End Sub
VBA/HTML-CodeConverter, AddIn für Office 2002-2016 - in VBA geschrieben von Lukas Mosimann. Projektbetreuung:RMH Software & Media
Code erstellt und getestet in Office 16 - mit VBAHTML 12.6.0
A | B | C | D | E | F | |
1 | Gruß Sepp | |||||
2 | ||||||
3 |
A | B | C | D | E | F | |
1 | Gruß Sepp | |||||
2 | ||||||
3 |