SjoerdV / ConvertOneNote2MarkDown

Ready to make the step to Markdown and saying farewell to your OneNote, EverNote or whatever proprietary note taking tool you are using? Nothing beats clear text, right? Read on!
GNU General Public License v3.0
196 stars 113 forks source link

Error: Server execution failed #11

Closed radziop closed 3 years ago

radziop commented 3 years ago

Hi, I was trying to run script over my nootebooks but every time I'm getting the following error:


due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005
(CO_E_SERVER_EXEC_FAILURE)).
At C:\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:18 char:14
+   $OneNote = New-Object -ComObject OneNote.Application
+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [New-Object], COMException
    + FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand

You cannot call a method on a null-valued expression.
At C:\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:21 char:3
+   $OneNote.GetHierarchy("", [Microsoft.Office.InterOp.OneNote.Hierarc ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "ReleaseComObject" with "1" argument(s): "Object reference not set to an instance of an object."
At C:\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:216 char:3
+   [System.Runtime.Interopservices.Marshal]::ReleaseComObject($OneNote ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NullReferenceException

Remove-Variable : Cannot find a variable with the name 'OneNote'.
At C:\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:217 char:3
+   Remove-Variable OneNote
+   ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (OneNote:String) [Remove-Variable], ItemNotFoundException
    + FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.RemoveVariableCommand```

I installed pandoc and I am using an absolute path. Onenote is opened when executing the script. OS: Win 10 18363
SjoerdV commented 3 years ago

Hi @radziop. Depending on your Windows configuration you might need to run both OneNote and the Powershell Terminal elevated (run as administrator). #GoogleIsYourFriend

http://asaconsultant.blogspot.com/2015/03/getting-things-done.html?m=1