選択した電子メールをすべての添付ファイルを特定の場所に保存するOutlookプロジェクトがあります。 それから、私はExcelブック、マクロを含んでいます。これは、保存されたファイルをチェックし、何かをします。 私は、OutlookのプロジェクトからExcelのマクロを呼び出したいが、私はエラーを取得しています:OutlookでExcelマクロを実行する:実行時エラー '-2147417851(80010105)'
実行時エラーオブジェクトの「-2147417851(80010105)」メソッド「ファイル名を指定して実行」「_Application」を
を失敗しました私はエラーを取得していますコードは、次のとおりです。
Sub CheckRDSFiles()
Dim fso As New FileSystemObject
Dim files As TextStream
Dim strFolderPath As String
Dim exApp As Excel.Application
Dim check_RDS As Workbook
Dim readROW As String
'Create complete folder to save files
strFolderPath = SAVE_TO_FOLDER & Format(Now, "MMMM") & "\" & Format(Date, "yyyy-MM-DD") & "\"
'File that stores files to be processed
Set files = fso.OpenTextFile(strFolderPath & "files.txt", ForReading, True, TristateUseDefault)
'Create excel application and open excel workbook with macro
Set exApp = New Excel.Application
Set check_RDS = exApp.Workbooks.Open(CHECK_RDS_PATH)
exApp.Visible = True
'Reading file
Do Until files.AtEndOfStream
'each line represent path to one file
readROW = files.ReadLine
Debug.Print readROW
'call macro from workbook "gatekeeper.xlsm" in module "Test" with name "test" and with parametres
check_RDS.Application.Run "gatekeeper.xlsm!Test.test", readROW, strFolderPath
Loop
End Sub
エラーがライン上にある:
check_RDS.Application.Run "gatekeeper.xlsm!Test.test", readROW, strFolderPath
楽しい部分は、問題なく実行できるということですが、毎回問題なく実行する必要があります。
また、このエラーが発生したときにExcelがフリーズし、タスクマネージャを使用してシャットダウンする必要があります。
実行時エラー「438」:オブジェクトはこのプロパティまたはメソッドをサポートしていません。 –