We help IT Professionals succeed at work.

VBE not showing existing code

118 Views
Last Modified: 2018-10-09
After years of programming in most of the Microsoft Office suite applications, this morning I was hit by an anomaly.

The VBE will not show the code, any existing code. I can write code but once saved and reopened it all vanishes. This happens with all Office files (Word, Excel, Access etc.). The modules appear the the VBE tree, but when opening one, the VBE remains blank as if a module was never opened. The code however does exist as it runs as expected and when a module is exported the bas file contains all the code. Yet for some reason the code is not shown in the VBE.

On other computers everything works, so the problem is not with the files but rather with the computer\ Office installation. Rebooted Windows, re-installed Office, yet problem persists.

Searching online it seems that a handful of users experienced the same issue but I couldn't find a solution.

Ideas are welcome and your help is greatly appreciated.


EDIT: If I search for a function only that function will be shown.
Comment
Watch Question

Zaheer IqbalTechnical Assurance & Implementation
CERTIFIED EXPERT

Commented:
Have you had any updates on the machine ?
What happens if you run VB application in compatible mode to use a lower version of Windows ?
CERTIFIED EXPERT
Top Expert 2016

Commented:
you might get this if text and background color are equal. you should see that by using 'End' key of your key board on some lines. if so, check if you were able to change either background color or text color.

Sara
CERTIFIED EXPERT

Author

Commented:
Thanks sarabande, but this doesn't help Option Explicit does show on the top then I can go down 2 lines but that's it. Changed both the foreground and the background, same problem.
CERTIFIED EXPERT
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
I would run a reinstall to clean up this unusual state of the installation.
CERTIFIED EXPERT

Author

Commented:
Thanks Gustav, but as mentioned in the question, uninstalling and reinstalling didn't help. I uninstalled using Microsoft's Removal Tool.
Zaheer IqbalTechnical Assurance & Implementation
CERTIFIED EXPERT

Commented:
have you tried compatibility mode ?
CERTIFIED EXPERT

Author

Commented:
Thank you Zaheer, no new updates were installed that I know of, everything worked fine last night.
I'm not sure where you're going with the compatibility issue, I'm dealing with Microsoft Office.
CERTIFIED EXPERT

Author

Commented:
Zaheer what should I run in compatibility mode?
Zaheer IqbalTechnical Assurance & Implementation
CERTIFIED EXPERT

Commented:
VBE application on the shortcut change the compatibility mode options to say Windows XP
CERTIFIED EXPERT

Author

Commented:
Shortcut to VBE?! What is that?
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013

Commented:
Is this happening with ALL files containing VBA, or is it limited to files in specific folders, etc?
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013

Commented:
Also, what versions of Office/Windows are you running on the problematic computer?
CERTIFIED EXPERT

Author

Commented:
mbizup It happens with all files that contain VBA.
The computer in question is running Windows 10 64 bit and Office 2016 Pro Plus 32 bit.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013

Commented:
Have you verified that none of the other windows (such as the Immediate or Watch windows) were inadvertently resized in a way that obscures the code window?

Can you post a screen shot of the full editor window?
CERTIFIED EXPERT

Author

Commented:
VBE ScreenShot
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013

Commented:
Glad you've got it resolved - what an obscure issue!
CERTIFIED EXPERT

Author

Commented:
Thanks guys :)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions