Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If by "envelope" you mean folder, you can use the Scripting.FileSystemObject
to get the various file dates. E.g., Sub AAA() Dim FSO As Object Dim FF As Object Set FSO = CreateObject("Scripting.FileSystemObject") Set FF = FSO.GetFolder("C:\Temp") '<<< CHANGE TO YOUR FOLDER Debug.Print FF.DateCreated, FF.DateLastAccessed, FF.DateLastModified End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Phil" wrote in message ... When I import a file I want to include the envelope information, i.e., file name, date and time created, along with each record. How can I do this |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Phil,
Depends how you are doing the import, but something along these lines: Dim FileName As String Dim strPath As String Dim FileDate As Date Const Ext As String = "xyz" strPath = "C:\SomeFolder\" FileName = Dir(strPath & "*." & Ext) Do While FileName < "" FileDate = FileDateTime(strPath & FileName) 'Do the import 'Or just read the line with the Open statement & Line Input/Input function FileName = Dir() Loop NickHK "Phil" wrote in message ... Thanks Chip, but I want the file info. I want to automate importing 30 files each day. Each file has one record, but with that record I need to know when it was created and the file name (which identifies the record). And where do you enter that code? Thanks. Phil "Chip Pearson" wrote: If by "envelope" you mean folder, you can use the Scripting.FileSystemObject to get the various file dates. E.g., Sub AAA() Dim FSO As Object Dim FF As Object Set FSO = CreateObject("Scripting.FileSystemObject") Set FF = FSO.GetFolder("C:\Temp") '<<< CHANGE TO YOUR FOLDER Debug.Print FF.DateCreated, FF.DateLastAccessed, FF.DateLastModified End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Phil" wrote in message ... When I import a file I want to include the envelope information, i.e., file name, date and time created, along with each record. How can I do this |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel file opens into a blue screen with no infomation | Excel Discussion (Misc queries) | |||
Bar graph pop-up infomation | Charts and Charting in Excel | |||
need more infomation on scatter charts? | Charts and Charting in Excel | |||
Match Infomation | Excel Worksheet Functions | |||
populate infomation from one worksheet to another if one of the c. | Excel Worksheet Functions |