Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime Error 5

Status
Not open for further replies.

anon1971

Programmer
Aug 9, 2008
88
US
Runtime Error 5 Invalid Procedure or Argument?
fso.MoveFile temp, "\\192.168.0.101\_file cabnet\"

never had this issue before until today
 
You are supplying two parameters to a function that only takes one.

From Access help:
[tt]object.Move destination[/tt]

object Required. Always the name of a File or Folder object.
destination Required. Destination where the file or folder is to be moved. Wildcard characters are not allowed.


 
thanks, Here is the entire code and I might add it has worked for over two years with no problem. Now I did formate this workstation that uses it but before no issues. i have checked Microsoft Scripting Runtime in References.

Dim stAppName As String
stAppName = """C:\Program Files\Common Files\Microsoft Shared\MSPaper\MSPSCAN.EXE"" Scan"
CreateObject("WScript.Shell").Run stAppName, 1, True
temp = getLastTIF("\\192.168.0.101\_file cabnet\temp\")
FilePath = "\\192.168.0.101\_file cabnet\" & Right(temp, Len(temp) - InStrRev(temp, "\"))

'Move File
Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFile temp, "\\192.168.0.101\_file cabnet\
 
Thanks Mad Oh i feel like an idiot MS Document Scan was not saving it to the temp file meaning it had nothing to move lol. fixed the code is not the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top