Dim openFileName As String openFileName = Application.GetOpenFilename("Excel ブック, *.xls*,CSV(コンマ区切り), *.csv, テキスト(タブ区切り), *.txt, すべてのファイル, *.*") If fileName = "False" Then Exit Sub End If Workbooks.Open openFileName
Dim openFileName As String openFileName = ThisWorkbook.Path & "/hoge.xlsx" If Dir(openFileName) = "" Then openFileName = Application.GetOpenFilename("Excel ブック, *.xls*,CSV(コンマ区切り), *.csv, テキスト(タブ区切り), *.txt, すべてのファイル, *.*") If openFileName = "False" Then Exit Sub End If End If Workbooks.Open openFileName