Excel deletes all macros from a file I open

Agustín Arenas 0 Reputation points
2023-02-09T14:58:04.9633333+00:00

Good, the file before opening it I enter in properties and I unblock it to show that it is a safe file (it is one that my brother uploads to one drive, program in VBA); besides that I enter that to enable macros and allow access to VBA objects, but despite all that still deletes it saying that I recover as much as possible but all the VBA DELETED, another file that I downloaded that had macros but not custom functions used in sheets of the file does not delete it, but I also tried telling my brother to delete all the sheets with custom functions and still delete the VBA, which calls my attention because one if and the other not. It could be that my brother touched something in VBA (own interface) that enabled by default the deletion of the VBA part if it was opened in another computer.

I also tried unchecking the three protected view boxes.

I hope you can help me thank you

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
4,717 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,816 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,713 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Hua-MSFT 27,636 Reputation points
    2023-02-10T07:08:34.3466667+00:00

    Hi @Agustín Arenas

    Does the issue not occur with your borther's machine?

    If so, can you change the change how files are obtained, such as via email attchments.

    After you download the file, please add file path as a trusted location in Office apps.

    Please also make sure the file format is not changed to .xls or .xlsx.

    Besides, please quit the antivirus software for a check.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.