Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

Data creazione File excel su vba

Ultimo Aggiornamento: 03/02/2016 14:17
Post: 123
Registrato il: 19/10/2011
Città: MILANO
Età: 32
Utente Junior
2010
OFFLINE
03/02/2016 11:22

Buongiorno a Tutti,

vorrei poter riconoscere la data di creazione di un file excel da VBA per poterla confrontare ed elaborare;

conoscete il codice VBA per ricavarla come variabile?

Grazie mille a Tutti
Buon lavoro

Andrea S.
excel 2010
Post: 2.895
Registrato il: 28/06/2011
Città: AGORDO
Età: 70
Utente Veteran
2013
OFFLINE
03/02/2016 13:37

Nell'editor strumenti/riferimenti devi aver abilitato microsoft scripting runtime.
Vedi quale data dei tre è piu idonea
Sub info()
Dim fso As New FileSystemObject
Dim fi As File
Set fi = fso.GetFile("C:\vba\serial MB.txt") 'percoso e nome file
MsgBox fi.DateCreated
MsgBox fi.DateLastAccessed
MsgBox fi.DateLastModified
End Sub
Excel 2013
Post: 123
Registrato il: 19/10/2011
Città: MILANO
Età: 32
Utente Junior
2010
OFFLINE
03/02/2016 14:17


 Dim fso As New FileSystemObject
                            Dim fi As File
                            Dim DT As Date
                            Set fi = fso.GetFile(ActiveWorkbook.Path & "/" & ActiveWorkbook.Name) 'percoso e nome file
                            
                            'MsgBox Day(fi.DateCreated) & "/" & Month(fi.DateCreated) & "/" & Year(fi.DateCreated)
                            'MsgBox fi.DateLastAccessed
                            'MsgBox fi.DateLastModified
                            
                            DT = Day(fi.DateCreated) & "/" & Month(fi.DateCreated) & "/" & Year(fi.DateCreated)




perfetto funziona benissimo, grazie
l'ho adattata cosi in quanto solo il comando dava sia data che ora
excel 2010
Vota:
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 21:15. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com