Re: Importing file envelope infomation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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 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" <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
this






.



Relevant Pages

  • Re: Trouble with getting latest file
    ... Dim FolderName As String ... Dim FileName As String ... If CurrentDateStamp> LatestDateStamp Then ...
    (microsoft.public.access.modulesdaovba)
  • Re: Trouble with getting latest file
    ... I also need to check that I will get the filename of the file with the ... Dim The_FileName As String ... If CurrentDateStamp> LatestDateStamp Then ...
    (microsoft.public.access.modulesdaovba)
  • Need Help with Inserting in SQL
    ... Public logoTable As String ... Dim logoTable As String ... Function InsertLogoToDataBase(ByVal FileName As String) As Variant ... Function GetAllFilesInDir(ByVal strDirPath As String) As Variant ...
    (microsoft.public.excel.programming)
  • Re: Dateidownload per WebRequest (async)
    ... ByVal DestinationDirectory As String, _ ... Dim Response As WebResponse = Request.GetResponse ... If ContentDisposition IsNot Nothing Then ... If Param Is "filename" Then ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • anyone help me?storing the path...
    ... ByVal lpBuffer As String) As Long ... Dim Nullchr As Integer ... (ByVal FileName$, ByVal dwHandle&, ByVal cbBuff&, ByVal lpvData$) ... Dim fld As Field ...
    (microsoft.public.access.modulesdaovba)