I simplified the problem for the purpose of this question:
I have a file Return13.xlsm
with following macro content:
Function Return13() As Integer
Return13 = 13
End Function
And following Powershell script:
$E = New-Object -ComObject Excel.Application
[Void]$E.Workbooks.Open("C:\MyMagicalFolder\Return13.xlsm")
$x = $E.Run("Return13")
In both Powershells I get following error:
Exception calling "Run" with "1" argument(s): "Exception from HRESULT: 0x800A03EC"
For the record - the functionality worked ~1month ago fine. Now - the only semi-constructive feedback on the matter I found on the "web" is that one of Windows Updates could brake it but I have no idea how to find it and what to do about it - given I work in enteprise environment and can't undo this patch (and I would have to do it on more than just my personal dev machine).
Any ideas?
For the record I have Windows 8.1 64bit with Office 365 32bit. Powershell Core used is 64bit and old Powershell 32bit.