View Single Post
 
Old 03-21-2018, 10:58 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

In that example you haven't populated the two string variables so it would struggle to work...
Code:
Sub aTest()
  Dim oldFile As String, newFile As String
  oldFile = "C:\Work\My Pictures\image1.wmf"
  newFile = "C:\Work\My Pictures\image2.wmf"
  Name oldFile As newFile 
End Sub
I must say I am surprised this is a valid command to rename a file. Name 'should' be a reserved word and can be used to show the name of the application
ie
debug.print Application.Name
debug.print Name
Both the above lines would return a string that shows the name of the current application.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote