Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-24-2011, 08:03 PM
cksm4 cksm4 is offline Rename File Windows XP Rename File Office 2007
Advanced Beginner
Rename File
 
Join Date: Aug 2010
Posts: 48
cksm4 is on a distinguished road
Default Rename File


Hello,

I am trying to rename the active document using this code:

Code:
 
Sub RenameFile()
     Dim sOldPathName As String
     sOldPathName = "G:\DATA\Test.docx"
     On Error Resume Next
     Name sOldPathName As "G:\DATA\TestWorked.docx"
     If Err Then MsgBox Err.Description
End Sub
I get this error: "File/Path access error". Is it not possible to rename a open file?

Much thanks for any insite anyone can provide... I have spent a lot of time researching this.

Brock
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename File Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM
Rename File Rename Outlook 2003 Contacts Folder sfpermits Outlook 6 07-21-2010 09:56 AM
linking a word file and an excell file on a macbook pro Fleur Office 0 07-14-2010 08:19 PM
Rename File How to open ppt file directly with slide show when clicked on file. praveen_p PowerPoint 1 05-06-2009 12:42 PM
Rename File code to save / rename / send attachments unit213 Outlook 1 09-26-2007 08:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft