Loading .xls file with macros using PowerShell Core for Mac

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Loading .xls file with macros using PowerShell Core for Mac



I am trying to load an Excel file using PowerShell Core for Mac but I am encountering an issue with New-Object. It's failing on the very first line


New-Object


$Excel = New-Object -ComObject Excel.Application



This is the error message I receive:



Has anyone encountered this issue and does anyone know how to fix it?





The Excel.Application COM object is only available when Excel is installed. And I'm not sure if the Mac version of MS Office even provides COM objects. You may want to consider using the ImportExcel PowerShell module instead.
– Ansgar Wiechers
Aug 10 at 13:41


Excel.Application


ImportExcel




1 Answer
1



The error message you're receiving says the -ComObject parameter is invalid. Judging from this issue posted on the powershell github I'd say -ComObject is invalid because it is not supported on the Mac platform.


-ComObject


-ComObject






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard