Running Excel Macro from Powershell/Powershell Core suddenly give 0x800A03EC error












0















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:MyMagicalFolderReturn13.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.










share|improve this question


















  • 1





    Check the file permissions and ensure you have read/write/execute. Also, make sure the worksheet is not protected.

    – Kirill Pashkov
    Nov 22 '18 at 12:22











  • Excel object model is enabled, all macros are allowed to run, file permissions are fine. The workbook is freshly crafted (new -> alt+f11 -> macro above -> save) so there's no protection on nothing.

    – nimdil
    Nov 22 '18 at 12:49











  • If that changes anything the wbscript gives the same error

    – nimdil
    Nov 22 '18 at 13:21






  • 1





    Try: $x = $E.Run('ThisWorkbook.Return13') cf stackoverflow.com/questions/19536241/…

    – Tragamor
    Nov 22 '18 at 23:00











  • @Tragamor thanks for suggestion - however the module prefix is not needed most of the time and haven't helped here either.

    – nimdil
    Nov 23 '18 at 9:50
















0















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:MyMagicalFolderReturn13.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.










share|improve this question


















  • 1





    Check the file permissions and ensure you have read/write/execute. Also, make sure the worksheet is not protected.

    – Kirill Pashkov
    Nov 22 '18 at 12:22











  • Excel object model is enabled, all macros are allowed to run, file permissions are fine. The workbook is freshly crafted (new -> alt+f11 -> macro above -> save) so there's no protection on nothing.

    – nimdil
    Nov 22 '18 at 12:49











  • If that changes anything the wbscript gives the same error

    – nimdil
    Nov 22 '18 at 13:21






  • 1





    Try: $x = $E.Run('ThisWorkbook.Return13') cf stackoverflow.com/questions/19536241/…

    – Tragamor
    Nov 22 '18 at 23:00











  • @Tragamor thanks for suggestion - however the module prefix is not needed most of the time and haven't helped here either.

    – nimdil
    Nov 23 '18 at 9:50














0












0








0








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:MyMagicalFolderReturn13.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.










share|improve this question














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:MyMagicalFolderReturn13.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.







excel vba excel-vba powershell powershell-core






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 11:46









nimdilnimdil

1,181718




1,181718








  • 1





    Check the file permissions and ensure you have read/write/execute. Also, make sure the worksheet is not protected.

    – Kirill Pashkov
    Nov 22 '18 at 12:22











  • Excel object model is enabled, all macros are allowed to run, file permissions are fine. The workbook is freshly crafted (new -> alt+f11 -> macro above -> save) so there's no protection on nothing.

    – nimdil
    Nov 22 '18 at 12:49











  • If that changes anything the wbscript gives the same error

    – nimdil
    Nov 22 '18 at 13:21






  • 1





    Try: $x = $E.Run('ThisWorkbook.Return13') cf stackoverflow.com/questions/19536241/…

    – Tragamor
    Nov 22 '18 at 23:00











  • @Tragamor thanks for suggestion - however the module prefix is not needed most of the time and haven't helped here either.

    – nimdil
    Nov 23 '18 at 9:50














  • 1





    Check the file permissions and ensure you have read/write/execute. Also, make sure the worksheet is not protected.

    – Kirill Pashkov
    Nov 22 '18 at 12:22











  • Excel object model is enabled, all macros are allowed to run, file permissions are fine. The workbook is freshly crafted (new -> alt+f11 -> macro above -> save) so there's no protection on nothing.

    – nimdil
    Nov 22 '18 at 12:49











  • If that changes anything the wbscript gives the same error

    – nimdil
    Nov 22 '18 at 13:21






  • 1





    Try: $x = $E.Run('ThisWorkbook.Return13') cf stackoverflow.com/questions/19536241/…

    – Tragamor
    Nov 22 '18 at 23:00











  • @Tragamor thanks for suggestion - however the module prefix is not needed most of the time and haven't helped here either.

    – nimdil
    Nov 23 '18 at 9:50








1




1





Check the file permissions and ensure you have read/write/execute. Also, make sure the worksheet is not protected.

– Kirill Pashkov
Nov 22 '18 at 12:22





Check the file permissions and ensure you have read/write/execute. Also, make sure the worksheet is not protected.

– Kirill Pashkov
Nov 22 '18 at 12:22













Excel object model is enabled, all macros are allowed to run, file permissions are fine. The workbook is freshly crafted (new -> alt+f11 -> macro above -> save) so there's no protection on nothing.

– nimdil
Nov 22 '18 at 12:49





Excel object model is enabled, all macros are allowed to run, file permissions are fine. The workbook is freshly crafted (new -> alt+f11 -> macro above -> save) so there's no protection on nothing.

– nimdil
Nov 22 '18 at 12:49













If that changes anything the wbscript gives the same error

– nimdil
Nov 22 '18 at 13:21





If that changes anything the wbscript gives the same error

– nimdil
Nov 22 '18 at 13:21




1




1





Try: $x = $E.Run('ThisWorkbook.Return13') cf stackoverflow.com/questions/19536241/…

– Tragamor
Nov 22 '18 at 23:00





Try: $x = $E.Run('ThisWorkbook.Return13') cf stackoverflow.com/questions/19536241/…

– Tragamor
Nov 22 '18 at 23:00













@Tragamor thanks for suggestion - however the module prefix is not needed most of the time and haven't helped here either.

– nimdil
Nov 23 '18 at 9:50





@Tragamor thanks for suggestion - however the module prefix is not needed most of the time and haven't helped here either.

– nimdil
Nov 23 '18 at 9:50












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430312%2frunning-excel-macro-from-powershell-powershell-core-suddenly-give-0x800a03ec-err%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430312%2frunning-excel-macro-from-powershell-powershell-core-suddenly-give-0x800a03ec-err%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

'app-layout' is not a known element: how to share Component with different Modules