Access vba help - Network Path

p4nny

Board Regular
Joined
Jan 13, 2015
Messages
246
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
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Code:
InputPath = [URL="file://server/dfsroot$/Change/3/Impacts/testing/"][COLOR=#000000]\\server\dfsroot$\Change\3\Impacts\testing[/COLOR][/URL][B][COLOR=#FF0000][/COLOR][/B][URL="file://server/dfsroot$/Change/3/Impacts/testing"][B][COLOR=#FF0000]\[/COLOR][/B][/URL]

to enter code on here put [ CODE] in front of it and [ /CODE] at the end (without the spaces) :)
 
Upvote 0
Hi

I've found the issue but unsure how to resolve it

My input path "\\server\dfsroot$\Change\3\Impacts\testing has a number of subfolders. Rather than name each subfolder explicitly, I would like to search "testing" and its subfolders

Does that make sense? Is it something you could possibly assist with?

Many thanks
 
Upvote 0

Forum statistics

Threads
1,223,956
Messages
6,175,611
Members
452,660
Latest member
Zatman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top