LifesAGarden
New Member
- Joined
- May 2, 2016
- Messages
- 4
I have the code below. which appends data to a table in Access. It also renames the file(adds "completed" to the front) and puts it in another folder. The issue is, it puts the renamed files in my "Documents" folder, when i want them to be placed in the following folder, "C:\Users\user1\Desktop\TEst\Completed\".
How or where do i change the VBA so that it saves the file to "C:\Users\user1\Desktop\TEst\Completed\"
Sub Import_Multi_Excel_Files()
Dim InputFile As String
Dim InputPath As String
InputPath = "C:\Users\user1\Desktop\TEst\Work\"
InputFile = Dir(InputPath & "*.xls")
Do While InputFile <> ""
If InputFile Like "Completed*" Then
Else
DoCmd.TransferSpreadsheet acImport, , "Checks", InputPath & InputFile, True '< The true is for column headers
Name InputPath & InputFile As "Completed" & InputFile
End If
InputFile = Dir
Loop
End Sub
How or where do i change the VBA so that it saves the file to "C:\Users\user1\Desktop\TEst\Completed\"
Sub Import_Multi_Excel_Files()
Dim InputFile As String
Dim InputPath As String
InputPath = "C:\Users\user1\Desktop\TEst\Work\"
InputFile = Dir(InputPath & "*.xls")
Do While InputFile <> ""
If InputFile Like "Completed*" Then
Else
DoCmd.TransferSpreadsheet acImport, , "Checks", InputPath & InputFile, True '< The true is for column headers
Name InputPath & InputFile As "Completed" & InputFile
End If
InputFile = Dir
Loop
End Sub