I want to move folders which are on network using Access VBA.
When I click button on form, it shall execute VBA code.
The below program moves local PC folders, when \\?\ is removed from the code. Using \\?\ before any network folder path, it is creating new folder on network.
When I want to move folders it is giving:
Run time Error 5 : Invalid Procedure call or Argument.
Upon debug , it highlights objF.MoveFolder oldStr, newStr
Private Sub btnBrowse_Click()
Dim oldStr As String
Dim newStr As String
Dim objF As Object
Me.OldPath = Me.FolderPath
Me.NewPath = GetFolder()
If Len(Me.NewPath) > 0 Then
Me.NewPath = "\\?\" & Me.NewPath
Me.FolderPath = Me.NewPath
Set objF = CreateObject("Scripting.FileSystemObject")
oldStr = Me.OldPath & "\*"
newStr = Me.NewPath & "\"
objF.MoveFolder oldStr, newStr
End If
End Sub
\\?\has noting to do with networks. Networks are\\servername\sharename\folder\file.ext- Noodles\\?\tells windows the programs knows the path can be up to 32K and Windows turns off checks for legal windows filenames. - Noodles