Access VBA今使っているファイルのパスを
VBAで、現在のMDBファイルのパスを取得する。
条件:
C:\にTESTフォルダ
TESTフォルダのSample.mdbとsample.xls
’パスのみ
Debug.Print Application.CurrentProject.Path
C:\TEST
’ファイル名のみ
Debug.Print Application.CurrentProject.Name
SAMPLE.mdb
’パスとファイル名
Debug.Print Application.CurrentProject.FullName
C:\TEST\SAMPLE.mdb
’パスとファイル名
Debug.Print Application.CurrentDb.Name
C:\TEST\SAMPLE.mdb
条件:
C:\にTESTフォルダ
TESTフォルダのSample.mdbとsample.xls
’パスのみ
Debug.Print Application.CurrentProject.Path
C:\TEST
’ファイル名のみ
Debug.Print Application.CurrentProject.Name
SAMPLE.mdb
’パスとファイル名
Debug.Print Application.CurrentProject.FullName
C:\TEST\SAMPLE.mdb
’パスとファイル名
Debug.Print Application.CurrentDb.Name
C:\TEST\SAMPLE.mdb
"Access VBA今使っているファイルのパスを" へのコメントを書く