How to get selected path and name of the file opened with file dialog?

后端 未结 12 771
面向向阳花
面向向阳花 2020-12-29 12:14

I need the path name and file name of the file that is opened with File Dialog. I want to show this information with a hyperlink in my worksheet.

With this code I ha

12条回答
  •  醉酒成梦
    2020-12-29 13:10

    To extract only the filename from the path, you can do the following:

    varFileName = Mid(fDialog.SelectedItems(1), InStrRev(fDialog.SelectedItems(1), "\") + 1, Len(fDialog.SelectedItems(1)))
    

提交回复
热议问题