Visual Basic does not display the code

Anonymous
2017-09-08T10:41:34+00:00

Hello,

Whenever I want to "view code" of Modules in Visual Basic, empty window appears with blank content.

Steps that I want to do:

Right click on module and press view code

Next want to edit/view code, but blank window appears

This is only happening with some files which uses VBA codes. (Iam using this VBA scripts inside Excel 2016)

additional information:

Thank you!

-Office 365 for Business

-Windows 7 Enterprise

Saso Pavlic

***Post moved by the moderator to the appropriate forum category.***

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Anonymous
    2017-09-11T07:54:19+00:00

    Hi Saso,

    Please check the following article, see if this helps:

    VBA code "behind" a worksheet or a workbook may not work in Excel

    You can also check this thread for the suggestions.

    ***Disclaimer:***Microsoft provides no assurances and/or warranties, implied or otherwise, and is not responsible for the information you receive from the third-party linked sites or any support related to technology

    If the issue persists, I’ll suggest you Online Repair your Office applications. To do this, follow the steps from the article below: Repair an Office application

    Thanks,

    Neha

    0 comments No comments
  2. Anonymous
    2017-09-11T14:00:53+00:00

    Hi Neha

    None of the suggestion helped me to fix my issue. Iam still unable to open "view code" of any file in Visual Basic, no matter if it is (Module,Form, Microsoft Excel Object). If i would say that i have 100 Excel files this error appears in 1/3 of them.

    Is it possible to somehow recover data and formulas, queries... and insert them into new Excel file. Can you guide me?

    Thanks & regards

    Saso

    0 comments No comments
  3. Anonymous
    2017-09-12T06:12:05+00:00

    Hi Saso,

    To troubleshoot this issue, please provide the following information:

    1. Where are the workbooks stored, on your local system or cloud location, such as OneDrive or OneDrive for business?
    2. Are the affected Workbook shared with others?
    3. If possible, can you try opening the affected workbook in a different computer, see if the issue persists.
    4. Please run Excel in safe mode, see if you can view the code now. You can check this article to know how to run Office applications in safe mode.

    Thanks,

    Neha

    0 comments No comments
  4. Anonymous
    2017-09-12T06:59:20+00:00

    Hi Neha,

    1. Workbooks are stored on OneDrive for business.
    2. Yes, affected Workbooks are shared with others.
    3. I tried to open affected Workbooks on many computers in our organization and the issue is the same in all cases.
    4. Running Excel in safe mode also didn't solve problem on viewing code.

    I also noticed, when I want to open Excel and then try to save it (which will lead to error), but on the same time Excel create one additional file.

    Need to inform you that this ticket is also created by me as this one ( Excel file from SharePoint crashes on save )

    If this will give you more information maybe.

    Regards

    Saso

    0 comments No comments
  5. Anonymous
    2017-09-13T06:56:43+00:00

    Hi Saso,

    Yesterday, a new build for Deferred channel was released. I’ll suggest you update Office to the latest version, see if this fixes the problem. You can check this article for Office version information.

    To know how to update Office, see Install Office updates

    If the problem persists, please stop sharing one of your affected Workbook and then check if you can view code. For the detailed information about how to stop sharing the file in OneDrive for business, please check this article.   

    If the problem remains, please provide any affected workbook for testing. You can provide the workbook in a private message. Please click here to access your PM.

    Thanks,

    Neha

    0 comments No comments