Hi, Apologies - I'm unsure how to post code into the forum.
There is an issue with InputPath. It does not like the network/server name. It will work fine when it is local (my documents) I've also tried using the drive mapping letter. Any suggestions 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 with InputPath. It does not like the network/server name. It will work fine when it is local (my documents) I've also tried using the drive mapping letter. Any suggestions 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