Share via

Excel Visual Basic Code Vanished

Anonymous
2024-09-10T02:09:29+00:00

I spent the entire day today coding in Excel's built-in Visual Basic editor. I saved constantly. At the end of the day I closed Excel. Can you guess what happened next? When I reopened my Excel file and navigated to the VB area the code was NOWHERE to be found. Is the Visual Basic code in some separate file somewhere? In the VB editor itself I was constantly clicking the disk icon throughout the day to save my code.

So what now?

Will I need to spend another six hours tomorrow re-writing the code that vanished? And, if I do - how can the code be saved?

Microsoft 365 and Office | Excel | For business | 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

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-09-10T06:28:38+00:00

    If you want to save macro in your file, you need to choose xlsm file format. Xlsx format cannot save macro in it?

    Is there any notice when you closed your workbook?

    Is there any error message when you open your file?

    Could you share that file to check on it? Sometimes, it will show all the macros when you open that file on another machine.

    For sharing file, you may upload it to OneDrive or any other cloud drive and then post the link here.

    *Please make sure you have removed any sensitive or private information in the sample file before uploading.

    Was this answer helpful?

    0 comments No comments