Dim str as String Dim wb as Workbook str = Application.GetOpenFilename →OK str = Workbooks.Open(Application.GetOpenFilename) →NG Set wb = Application.getOpenfilename →NG Set wb = Workbooks.Open(Application.GetOpenFilename) →OK
オブジェクトブラウザーを見ると勉強になるよ それぞれ、こうなっている Class Application Function GetOpenFilename()
Class Workbooks Function Open(Filename As String) As Workbook