Connettore Excel modifica la properties; "data modificata" del file – SSIS

Sto lavorando con alcuni file excel. L'idea è quella di prendere solo quelle che sono state modificate. Ma qui ho il problema. Quando eseguo il pacchetto completo, il connettore Excel modifica la "data modificata" con l'ora di sistema. Questi file non hanno la properties; "Read Only" e non posso fare nulla in merito, perché ho appena letto i file da una cartella specifica.

Qual è l'approccio migliore per affrontare questo problema ?.

In questo modo è ansible leggere la data modificata di un file senza aprirla, tutti da excel.

 Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Sub test () Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Dim FD Come FileDialog Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Dim i Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Se .Show = -1 Poi Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Avanti i Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Fine con Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function End Sub Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Dim s come string Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Impostare fs = CreateObject ("Scripting.FileSystemObject") Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function Impostare f = fs.GetFile (strFullFileName) Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function s = UCase (strFullFileName) & vbCrLf Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function s = s & "Ultima modifica:" & f.DateLastModified Sub test() Dim FD As FileDialog Dim i Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD If .Show = -1 Then For Each i In .SelectedItems MsgBox FileLastModified(i) Next i End If End With End Sub Function FileLastModified(ByVal strFullFileName As String) Dim fs As Object Dim f As Object Dim s As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(strFullFileName) s = UCase(strFullFileName) & vbCrLf s = s & "Last Modified: " & f.DateLastModified FileLastModified = s Set fs = Nothing: Set f = Nothing End Function