excel - Go up one folder level -


i have macro gets sub folder data. want main folder.

i looked @ how current working directory using vba? need change activeworkbook path:

application.activeworkbook.path might "c:\parent\subfolder" 

i want

"c:\parent\" 

using excel 365 vba

as path may not current working directory need extract path string.

find last \ , read characters left:

parentpath = left$(path, instrrev(path, "\")) 

if working around current directory chdir ".." jump 1 level, new path can returned currdir.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -