I am using the following PowerShell script to trigger an Excel macro.
The Excel macro processes existing text files and creates new text files.
The Excel macro on its own is working, but when I trigger it using PowerShell, the text files are not created.
$excel = new-object -comobject excel.application
$workbook = $excel.workbooks.open("C:\Pre_Post_Remote.xlsm")
$excel.Run("pre_post_remote", $fpath, $ptype, $ftype)
$workbook.save()
$workbook.close()
$excel.quit()
There are no errors. It runs and nothing happens. I suspect it is because of Scripting.FileSystemObject
used within the macro to create text file.