T
THE_RAMONES
I hope someone can help me out...
I'm trying to import an excel file that is updated daily, same format,
naming convention, except that date and time are added to the naming
convention...
I want to import and an add a field that either collect date modified or
date within the file... Preferrably by date modified... Code I'm using is
below.. I appreciate the help
Option Compare Database
Function ImportCSAT()
Dim strFile As String
Dim strPath As String
Dim stDocName As String
'File path '
strPath = "F:\Shared\PFFS_IT\Prod_Env\TMG_Inbound_Files\Customer_Service"
'Change the default directory to the file path
'
ChDir strPath
'Find the firstxls file
'
strFile = Dir("WCARE_DAILY_CONTACT_LOG_2007**.xls")
stDocName = ("She*")
'Loop through the string & import the files
'
Do While Len(strFile) > 0
DoCmd.TransferSpreadsheet acImport, , "xls_PFFS_Direct", strFile, True
'delete the file (consider moving it to an Archive folder instead.)
' Kill strPath & "/" & strFile
'Call Dir to get the next file
'
strFile = Dir
Loop
End Function
I'm trying to import an excel file that is updated daily, same format,
naming convention, except that date and time are added to the naming
convention...
I want to import and an add a field that either collect date modified or
date within the file... Preferrably by date modified... Code I'm using is
below.. I appreciate the help
Option Compare Database
Function ImportCSAT()
Dim strFile As String
Dim strPath As String
Dim stDocName As String
'File path '
strPath = "F:\Shared\PFFS_IT\Prod_Env\TMG_Inbound_Files\Customer_Service"
'Change the default directory to the file path
'
ChDir strPath
'Find the firstxls file
'
strFile = Dir("WCARE_DAILY_CONTACT_LOG_2007**.xls")
stDocName = ("She*")
'Loop through the string & import the files
'
Do While Len(strFile) > 0
DoCmd.TransferSpreadsheet acImport, , "xls_PFFS_Direct", strFile, True
'delete the file (consider moving it to an Archive folder instead.)
' Kill strPath & "/" & strFile
'Call Dir to get the next file
'
strFile = Dir
Loop
End Function