Loading .xls file with macros using PowerShell Core for Mac
Clash 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?
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.
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 theImportExcel
PowerShell module instead.– Ansgar Wiechers
Aug 10 at 13:41