How to get the excel file name / path in VBA

前端 未结 6 1652
粉色の甜心
粉色の甜心 2021-01-07 15:58

Say, I\'m writing a VBA inside my excel file sample.xls. Now I want to get the full path of sample.xls in my VBA. How do I do it?

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-07 17:00

    If you need path only this is the most straightforward way:

    PathOnly = ThisWorkbook.Path
    

提交回复
热议问题