NoNameNo123
NoNameNo123

Reputation: 665

VBA Excel: Module visible in the project explorer, but not the code window

I'm on Windows 10, Excel 2016.

I have a project I've been working on for quite a while. It consists of a userform and two modules. Now, after a week or so, I've opened the Excel file containing the code again. I see the modules and userform in the project explorer; I can view the code of the userform and one of the modules. However, the other module doesn't show me the code window. I double click on it and it doesn't appear.

When double clicking on the module, the module name (under module properties, below the project explorer) does change. However, if from there I try to change the name of either module, I get the error message "Can't perform requested operation". Changing the userform's name works.

Any idea what I can do about this?

Upvotes: 3

Views: 27582

Answers (2)

Ben Carroll
Ben Carroll

Reputation: 113

If someone comes across the same issue but the suggested solution of cascading the code windows doesn't do the trick, this approach has helped me numerous times:

Under Excel Options -> Trust Centre -> Trust Centre Settings

  • -> External Content: set all radio buttons to disable
  • -> Macro Settings: disable VBA macros without notification, untick the checkboxes
  • -> ActiveX Settings: disable all controls without notification
  • -> Add-ins: tick the checkbox Disable all Add-ins
  • -> Trusted Add-in Catalogs: tick the checkbox Don't allow any web add-ins to start
  • -> Trusted Documents: tick the checkbox Disable Trusted Documents
  • -> Trusted Locations: tick the checkbox Disable all Trusted Locations

Restart Excel, open the file that plays up, open VBA and in the menu bar click on Debug -> Compile VBAProject, then save your file, and under Excel Options -> Trust Centre reset all changed settings, and restart Excel.

Upvotes: 11

braX
braX

Reputation: 11755

At the top of the code window (in the menu bar)... click on Window... and then Cascade

the child window is most likely just moved off the edge of the screen and that should reset it.

Upvotes: 5

Related Questions