Application.FileDialog
この記事によると、Excel 2011 には存在しません。代わりにこのソリューションを試してください。関数が作成されます。
解決策は次のとおりで、Macintosh でも動作するようにします。
Function myGetOpenFileName(Optional sPath As String) As String
Dim sFile As String
Dim sMacScript As String
If isMac Then
If sPath = vbNullString Then
sPath = "the path to documents folder"
Else
sPath = " alias """ & sPath & """"
End If
sMacScript = "set sFile to (choose file of type ({" & _
"""com.microsoft.Excel.xls"",
""org.openxmlformats.spreadsheetml.sheet"",
""public.comma-separated-values-text"", ""public.text"",
""public.csv"",
""org.openxmlformats.spreadsheetml.sheet.macroenabled""}) with prompt " & _
"""Select a file to import"" default location " & sPath & ") as string" _
& vbLf & _
"return sFile"
Debug.Print sMacScript
sFile = MacScript(sMacScript)
Else 'windows
sFile = Application.GetOpenFilename("CSV files,*.csv,Excel 2007 files,*.xlsx", 1, _
"Select file to import from", "&Import", False)
End If