Re: Importing file envelope infomation
- From: Phil <Phil@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Jan 2007 06:23:01 -0800
Thanks. I'll let you know how it goes when I get back to it.
Phil
"NickHK" wrote:
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" <Phil@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F4D6CC7F-F326-4148-AD55-9571219AE515@xxxxxxxxxxxxxxxx
Thanks Chip, but I want the file info. I want to automate importing 30files
each day. Each file has one record, but with that record I need to knowwhen
it was created and the file name (which identifies the record).Scripting.FileSystemObject
And where do you enter that code?
Thanks.
Phil
"Chip Pearson" wrote:
If by "envelope" you mean folder, you can use the
thisto 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" <Phil@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FD6522CB-5687-4708-93F2-1ADB61D2E52D@xxxxxxxxxxxxxxxx
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
- References:
- Re: Importing file envelope infomation
- From: Chip Pearson
- Re: Importing file envelope infomation
- From: NickHK
- Re: Importing file envelope infomation
- Prev by Date: Hyperlink
- Next by Date: Re: Array of UDT
- Previous by thread: Re: Importing file envelope infomation
- Next by thread: Re: Need a code to print and save file as
- Index(es):
Relevant Pages
|