Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

Code Explorer does not show all open workbooks

Open hauffautomation opened this issue 2 years ago • 8 comments

Version 2.5.2.5906 OS: Microsoft Windows NT 10.0.19043.0, x64 Host Product: Microsoft Office 2016 x86 Host Version: 16.0.5188.1000 Host Executable: EXCEL.EXE

Description Code Explorer does not show all open workbooks

Edit All workbook are password protected (except Stammdaten).

Edit If I enter the password for each "workbook" and then update, the "workbooks are displayed in the "Code Explorer".

"Stammdaten.xlsx" is a hidden workbook "Einrichtermappe (83986_Einrichtinfo.xlsm)" is a visible workbook The other two are addin's (xlam)

2021-09-09_092345

hauffautomation avatar Sep 09 '21 07:09 hauffautomation

Just to cover the obvious, if you collapse the Library References and VBAProject trees in the CE, those are the only two that show?

daFreeMan avatar Sep 10 '21 12:09 daFreeMan

Yes only Stammdaten.xlsx are shown. To view the others, I have to enter the password and update the "Code Explorer".

hauffautomation avatar Sep 10 '21 13:09 hauffautomation

I believe that's by design. Since RubberDuck can't parse the code if it's in a locked workbook, I believe that it doesn't even bother listing it.

That would make sense - if you sell me your 83986_Einrichtinfo.xlsm and it's locked, you don't want me to be able to open up RD and parse/view your code, right? This would prevent the duck from even wasting time trying to parse something that it knows it cannot parse.

I'm sure someone with more in-depth knowledge than I have will be along to confirm this, but at the moment, I don't think it's a bug.

daFreeMan avatar Sep 10 '21 14:09 daFreeMan

Yes, that is correct. But it is not possible to do without the project explorer, because you need it for unlocking. Of course, if the API doesn't allow it, there's not much you can do.

hauffautomation avatar Sep 10 '21 14:09 hauffautomation

I agree with the fact that it is not a bug.

hauffautomation avatar Sep 10 '21 14:09 hauffautomation

There are multiple reasons why the code explorer does not show locked projects.

Currently, the code explorer works exclusively off declarations parsed from the user code. Since there is no access to the code in locked projects, these are not shown.

For some time, we can actually see the structure of locked projects through some trickery.; the code is still not accessible. So, in principle, we could show the structure of locked projects, with the obvious restriction that there could not be any navigation to the code. However, the question is whether that would be a good idea. As stated above by @daFreeMan, showing the internals of a protected project is rather intrusive.

One thing one could potentially think about is the to show the public components and members in the CE. However, that would require quite some rework, I think.

MDoerner avatar Sep 14 '21 06:09 MDoerner

If the locked structure would be displayed and you could then unlock the projects with the Code Explorer, i.e. the Code Explorer would offer the possibility to enter the password, it would make sense from my point of view.

hauffautomation avatar Sep 14 '21 06:09 hauffautomation

Any update? Still can't see password protected workbooks nor workbooks opened after loading Rubberduck - even after refreshing Code Explorer.

dovatti avatar Jun 20 '22 08:06 dovatti