Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excel 2016: unexpected error #4009

Closed
tdalon opened this issue May 15, 2018 · 9 comments
Closed

Excel 2016: unexpected error #4009

tdalon opened this issue May 15, 2018 · 9 comments
Labels
bug Identifies work items for known bugs difficulty-03-duck Involves more challenging problems and/or developing within and revising the internals API hacktoberfest Tags issues for Hacktoberfest 2019 stale Issue is no longer relevant, or was fixed and forgotten. If closed but still relevant, open a new.

Comments

@tdalon
Copy link

tdalon commented May 15, 2018

When I press refresh I get "Unexpected Error".
I have Excel 2016/ Win 7.
I have retried with latest pre-release.
image
Attached the log file.
RubberduckLog.txt

Many thanks.

@MDoerner
Copy link
Contributor

Thank you for reporting this.

To determine what went wrong we will need some more information. It would be great if you could go into the Rubberduck setting to enable logging, hit the refresh button again and post the log here. Trace level would be ideal, but if you fear to leak too much information about your project on that level, Warning or Error might be sufficient.

@Vogel612 Vogel612 added bug Identifies work items for known bugs support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask! labels May 15, 2018
@retailcoder
Copy link
Member

Log:

2018-05-15 19:28:44.4260;ERROR-2.2.6708.13023;Rubberduck.UI.Command.AddTestModuleCommand;System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Vbe.Interop.VBE'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{0002E166-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
   at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
   at Microsoft.Vbe.Interop.VBE.get_ActiveVBProject()
   at Rubberduck.VBEditor.SafeComWrappers.VBA.VBE.get_ActiveVBProject() in C:\projects\rubberduck\Rubberduck.VBEditor.VBA\SafeComWrappers\VB\VBE.cs:line 40
   at Rubberduck.UI.Command.AddTestModuleCommand.GetProject() in C:\projects\rubberduck\Rubberduck.Core\UI\Command\AddTestModuleCommand.cs:line 124
   at Rubberduck.UI.Command.AddTestModuleCommand.EvaluateCanExecute(Object parameter) in C:\projects\rubberduck\Rubberduck.Core\UI\Command\AddTestModuleCommand.cs:line 140
   at Rubberduck.UI.Command.CommandBase.CanExecute(Object parameter) in C:\projects\rubberduck\Rubberduck.Core\UI\Command\CommandBase.cs:line 28;System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Vbe.Interop.VBE'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{0002E166-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
   at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
   at Microsoft.Vbe.Interop.VBE.get_ActiveVBProject()
   at Rubberduck.VBEditor.SafeComWrappers.VBA.VBE.get_ActiveVBProject() in C:\projects\rubberduck\Rubberduck.VBEditor.VBA\SafeComWrappers\VB\VBE.cs:line 40
   at Rubberduck.UI.Command.AddTestModuleCommand.GetProject() in C:\projects\rubberduck\Rubberduck.Core\UI\Command\AddTestModuleCommand.cs:line 124
   at Rubberduck.UI.Command.AddTestModuleCommand.EvaluateCanExecute(Object parameter) in C:\projects\rubberduck\Rubberduck.Core\UI\Command\AddTestModuleCommand.cs:line 140
   at Rubberduck.UI.Command.CommandBase.CanExecute(Object parameter) in C:\projects\rubberduck\Rubberduck.Core\UI\Command\CommandBase.cs:line 28

@Vogel612 Vogel612 added difficulty-03-duck Involves more challenging problems and/or developing within and revising the internals API and removed support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask! labels May 16, 2018
@tdalon
Copy link
Author

tdalon commented May 18, 2018

If you need anytime to have a debugging Skype session with me just contact me (Matthieu got my email).

@comintern
Copy link
Contributor

@tdalon - I was taking a look at this and was trying to come up with reasons why LoadLibrary would be failing. Do you remember if you had any other add-ins loaded when you got this error?

This may be related to #3837 (need COM shims).

@bclothier
Copy link
Contributor

Pinging @tdalon to see if this is still an issue.

@Vogel612 Vogel612 added the hacktoberfest Tags issues for Hacktoberfest 2019 label Sep 20, 2019
@bclothier
Copy link
Contributor

This is an old issue and no followups. Assuming stale and closing. If this still is an issue, feel free to reopen.

Semi-automatic bug tracker automation moved this from ToDo to Done Oct 11, 2019
@bclothier bclothier added the stale Issue is no longer relevant, or was fixed and forgotten. If closed but still relevant, open a new. label Oct 11, 2019
@tdalon
Copy link
Author

tdalon commented Nov 7, 2019

I don't get an error anymore :-) Still the menu Indent stays greyed out. :-(

@bclothier
Copy link
Contributor

Thanks for the followup! To confirm, indent is disabled even after you've run the parse and selected a procedure or a module?

@retailcoder
Copy link
Member

retailcoder commented Nov 7, 2019

@tdalon whether the Code Explorer context menu's Indent command is enabled is dependent on parser state (because if it's not Ready then the Code Explorer nodes necessarily aren't up to date) and on what kind of node is selected - and it's disabled otherwise:

private bool SpecialEvaluateCanExecute(object parameter)
{
if (_state.Status != ParserState.Ready)
{
return false;
}
switch (parameter)
{
case CodeExplorerProjectViewModel project:
return _state.AllUserDeclarations
.Any(c => c.DeclarationType.HasFlag(DeclarationType.Module) &&
!c.Annotations.Any(pta => pta.Annotation is NoIndentAnnotation) &&
c.ProjectId == project.Declaration.ProjectId);
case CodeExplorerCustomFolderViewModel folder:
return folder.Children.OfType<CodeExplorerComponentViewModel>() //TODO - this has the filter applied.
.Select(s => s.Declaration)
.Any(d => !d.Annotations.Any(pta => pta.Annotation is NoIndentAnnotation));
case CodeExplorerComponentViewModel model:
return !model.Declaration.Annotations.Any(pta => pta.Annotation is NoIndentAnnotation);
case CodeExplorerMemberViewModel member:
return member.QualifiedSelection.HasValue;
default:
return false;
}
}

If parser state is Ready and the Code Explorer context menu is brought up with a right-click on a project, folder, module, or member node, (and the selected module/member doesn't have a '@NoIndent annotation,) and the command is still disabled, then something's off.

The ActiveX menu commands (main menu bar /"Rubberduck" menu, code pane context menu) however, don't even override CanExecute, so they should be enabled regardless of parser state (they do trigger a reparse once executed though). These are always enabled, correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs difficulty-03-duck Involves more challenging problems and/or developing within and revising the internals API hacktoberfest Tags issues for Hacktoberfest 2019 stale Issue is no longer relevant, or was fixed and forgotten. If closed but still relevant, open a new.
Development

No branches or pull requests

6 participants