Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21842

Invalid Procedure Call when "nothing" is wrong

$
0
0
Hi all.

I have a weird problem. I am doing a simple renaming of a file on a thumb drive, using:
Code:

Name OldFullPath_str As Rename_str
But I get an Invalid Procedure Call error when the strings are fine:

Attachment 92381

Now, in going back to the Help file, it seems to say that if the source and destination strings use the same drive, that only a folder can be renamed, not a file name. So I did this to see if the error would go away:
Code:

        If ParentFwdParsedPaths(6, TempSlot, TempPath) = 1 Then    'If entity is a folder.
          Name OldFullPath_str As Rename_str
        ElseIf ParentFwdParsedPaths(6, TempSlot, TempPath) = 2 Then    'If entity is a file.
          Tempo_str = "c:\" + ParentFwdParsedPaths(5, TempSlot, TempPath)    'File name prepped for the file being moved to c: drive.
          Name OldFullPath_str As Tempo_str    'File moved to c: drive.
          Name Tempo_str As Rename_str    'File moved back to original location, but with new name.
        End If

Alas...NoGo. In this case, the file gets to the c: drive fine, but will not copy back to the thumb drive. Also, if I change the folder name on the thumb drive, I have no problems with that.

I also thought there might be an invisible null character in the string that could cause the problem but with a combination of Trim() and Replace() that I have used in the past, I still get the same problem.

Thanks for any insight, on this! :)
Attached Images
 

Viewing all articles
Browse latest Browse all 21842

Trending Articles