VBA 03 - Application Path - get to Parent Folder

Dennis

Application: Excel

Left(ThisWorkbook.Path, InStrRev(ThisWorkbook.Path, "\") - 1)

I need to go back at least 2 Folders from the Workbook Path.

I cannot use Paths like "C:/Folder1", because the Application will be moved multiple times.

jacouh

Like this:

Function getParentFolder2(ByVal strFolder0)
  Dim strFolder
  strFolder = Left(strFolder0, InStrRev(strFolder0, "\") - 1)
  getParentFolder2 = Left(strFolder, InStrRev(strFolder, "\") - 1)
End Function


Dim strFolder
strFolder = getParentFolder2(ThisWorkbook.Path)

We here cut twice \subdir pattern...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

VBA 03 - Application Path - get to Parent Folder

From Dev

How to get spring boot application jar parent folder path dynamically?

From Dev

Using VBA, how can I get the immediate parent folder name from a path string?

From Dev

How to get path to the parent folder of a certain directory?

From Dev

Inno Setup - Get a path to parent folder

From Dev

Get path of parent folder of script location : Applescript

From Java

Best way to get application folder path

From Dev

How to get the name of the parent folder of a file specified by its full path?

From Dev

get relative path with just file name and name of the parent folder

From Dev

How to get the log folder path of a certain IIS Application/Site in VBScript

From Dev

How to get folder path of Installed application, from Visual Studio 2012

From Dev

VBA/Formula, Parse Parent of of Path

From Dev

Get folder by FolderId to find parent folder

From Dev

How to get parent folder of a directory

From Dev

Get the name of the parent folder in html

From Dev

Java - Deleting files and folder of parent path recursively

From Dev

How to select a folder and get folder path in grails?

From Dev

Get MediaStore path of a Specific Folder

From Dev

Get subset of path with specified folder

From Dev

How to get folder path runtime

From Dev

Get path to folder using zenity

From Dev

How to get the path of an internal folder?

From Dev

Get the resource folder path of an image

From Dev

Get the path of a closed folder with Applescript

From Dev

Get every folder inside path

From Dev

Get path to application?

From Dev

How to get path of any file from my my application data folder

From Dev

Shell.Application BrowseForFolder - how do I get full path of Folder object?

From Dev

How to get path of any file from my my application data folder

Related Related

  1. 1

    VBA 03 - Application Path - get to Parent Folder

  2. 2

    How to get spring boot application jar parent folder path dynamically?

  3. 3

    Using VBA, how can I get the immediate parent folder name from a path string?

  4. 4

    How to get path to the parent folder of a certain directory?

  5. 5

    Inno Setup - Get a path to parent folder

  6. 6

    Get path of parent folder of script location : Applescript

  7. 7

    Best way to get application folder path

  8. 8

    How to get the name of the parent folder of a file specified by its full path?

  9. 9

    get relative path with just file name and name of the parent folder

  10. 10

    How to get the log folder path of a certain IIS Application/Site in VBScript

  11. 11

    How to get folder path of Installed application, from Visual Studio 2012

  12. 12

    VBA/Formula, Parse Parent of of Path

  13. 13

    Get folder by FolderId to find parent folder

  14. 14

    How to get parent folder of a directory

  15. 15

    Get the name of the parent folder in html

  16. 16

    Java - Deleting files and folder of parent path recursively

  17. 17

    How to select a folder and get folder path in grails?

  18. 18

    Get MediaStore path of a Specific Folder

  19. 19

    Get subset of path with specified folder

  20. 20

    How to get folder path runtime

  21. 21

    Get path to folder using zenity

  22. 22

    How to get the path of an internal folder?

  23. 23

    Get the resource folder path of an image

  24. 24

    Get the path of a closed folder with Applescript

  25. 25

    Get every folder inside path

  26. 26

    Get path to application?

  27. 27

    How to get path of any file from my my application data folder

  28. 28

    Shell.Application BrowseForFolder - how do I get full path of Folder object?

  29. 29

    How to get path of any file from my my application data folder

HotTag

Archive