You should use the macro recorder to record yourself opening a file and saving it in a new location.
You will get something like this.
Sub Macro3()
'
' Macro3 Macro
'
'
ChDir "C:\Users\Mehmetcik\Application Data\Desktop\Searcher"
Workbooks.Open(Filename:= _
"C:\Users\Mehmetcik\Application Data\Desktop\Searcher\Searcher.xlsm"). _
RunAutoMacros Which:=xlAutoOpen
Windows("Searcher.xlsm").Activate
ChDir "C:\Users\Mehmetcik\Application Data\Desktop\Export"
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\Mehmetcik\Application Data\Desktop\Export\Searcher.xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
If you use
InstrRev you can strip out the Filename and the path name
FullPath = "C:\Users\Mehmet\Application Data\Desktop\Searcher"
MyPath = Left(FullPath, InStrRev(FullPath, "\"))
MyName = Right(FullPath, Len(FullPath) - Len(MyPath))
Alternatively you could use these functions:-
MyPath = ActiveWorkbook.Path
MyCompletePath = ActiveWorkbook.FullName
MyName = ActiveWorkbook.Name
Bookmarks