p4nny
05-31-2017, 09:22 AM
Hi, Apologies - I'm unsure how to post code into the forum.
There is an issue InputPath. It does not like the network/server name. It will work fine when it is local (my documents) also tried using the drive mapping letter. Any suggestion at all?
Here's my code:
Public Function Import_Multi_Excel_Files()
Dim InputFile As String
Dim InputPath As String
InputPath = "\\server\dfsroot$\Change\3\Impacts\testing\"
InputFile = Dir(InputPath & "*.xlsx")
Do While InputFile <> ""
DoCmd.TransferSpreadsheet acImport, , "tests" & Format(Now(), "ddmmyy"), InputPath & InputFile, True, "Action Plan!"
InputFile = Dir
Loop
End Function
There is an issue InputPath. It does not like the network/server name. It will work fine when it is local (my documents) also tried using the drive mapping letter. Any suggestion at all?
Here's my code:
Public Function Import_Multi_Excel_Files()
Dim InputFile As String
Dim InputPath As String
InputPath = "\\server\dfsroot$\Change\3\Impacts\testing\"
InputFile = Dir(InputPath & "*.xlsx")
Do While InputFile <> ""
DoCmd.TransferSpreadsheet acImport, , "tests" & Format(Now(), "ddmmyy"), InputPath & InputFile, True, "Action Plan!"
InputFile = Dir
Loop
End Function