Originally Posted by
moke123
Code:
Fpath = "C:\Users\Sam\Desktop\tinkering\Files\SomeFile.accdb"
Debug.Print Replace(Fpath, fso.GetExtensionName(Fpath), "txt")
Code:
result: C:\Users\Sam\Desktop\tinkering\Files\SomeFile.txt
What am I doing wrong here?
Code:
Dim fileName As String
Dim newName As String
Dim fso As Object
Set fso = CreateObject("scripting.FileSystemObject")
Debug.Print (Me.txtFileLocation)
fileName = Me.txtFileLocation
newName = Replace(fileName, fso.GetExtension(fileName), "txt")
Debug.Print newName
Set fso = Nothing
but I get an error of
Code:
Object doesn't support this property or method