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

后端 未结 12 694
面向向阳花
面向向阳花 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:00

    I think you want this:

    Dim filename As String
    filename = Application.GetOpenFilename
    
    Dim cell As Range
    cell = Application.Range("A1")
    cell.Value = filename
    

提交回复
热议问题