|
-
Jan 18th, 2012, 03:59 PM
#1
Thread Starter
Member
How to rename a file in VB6
Hi Folks, I'm sorry if this is a trivial question but here goes.
I wish to rename a file (a workbook in this case) leaving it in the same folder.
I am using: " name firstname.xls as newname.xls " after I have checked that firstname.xls exists. I get "File not found" failure.
Because the Path is very long, I can't view it by hovering the cursor over the variable MyPath but I think it is within the 255 character length allowed. On occasion this method has worked without the path before the file name but I don't know why it won't work now! I wondered whether I should be using a variant for the file names instead of a string variable.
I have also seen a "Rename" keyword suggested but if I type this into the help system it says keyword not recognised. Any help you can give me will be very much appreciated. Thanks in anticipation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|