Sub エクセルファイルのパスワード付きを開く() 開くファイル = "C:\サンプル.xlsx" Workbooks.Open 開くファイル, Password:="password" End Sub