|
ブックのある1つ上のフォルダ
MsgBox CreateObject("Scripting.FileSystemObject").GetParentFolderName(ThisWorkbook.Path)
MsgBox CreateObject("Scripting.FileSystemObject").Getfolder(ThisWorkbook.Path).ParentFolder
MsgBox CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(ThisWorkbook.Path & "\..")
ブックのある2つ上のフォルダ
MsgBox CreateObject("Scripting.FileSystemObject").GetFolder(ThisWorkbook.Path).ParentFolder.ParentFolder
MsgBox CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(ThisWorkbook.Path & "\..\..")
参考
ht tp://www.vbalab.net/vbaqa/c-board.cgi?cmd=ntr;tree=36400;id=exce
|
|