none
OLE file macros RRS feed

  • Question

  • Hello guys,
    First, i'm gonna present on which project i'm working : a python macro filter which kills each one found in an office file.

    I'm using a python library named Olevba, which is able to decompress and detect sensible macros. This library works fine, but in order to kills macros on XLS, i have to modify a binary file and replace each character by blank. There is some library that write directly on stream but the problem is the encryption ; i explain : when i separe header from macro's datas, then i combine old header and macro's data re-encrypted with python, Excel tells me at beginning that macro has changed. In order to respect security and avoid suspection on hacked Excel for my clients, i want to remove this message.

    The size of the new macro file is different from old one... i know it's about the encryption, it depends of the operating system (linux, win) and i suppose that the file detects a different encryption in macro then it tells me the error. Can you explain me more about it please.

    Thank you,
    Have a nice day.

    Cordially,

    Florian CECCHINI

    Tuesday, November 14, 2017 9:38 AM

All replies

  • Hi ,

    you had mentioned that you are using Python library OleVBA.

    I would like to inform you that we do not provide support for the Python library.

    on this forum, we only provide support for Excel VBA Object Model related issues.

    we are not aware about the OleVBA Python library.

    it is better if you provide some code and steps to reproduce the issue.

    so that we can check that whether it comes under the scope of this forum or not.

    I can see that your overall goal is to remove/ kill the macro.

    for that you can also refer some VBA examples which need not to use OleVBA.

    Reference:

    Remove all VBA code programmatically

    Delete all macros in a workbook/document using VBA in Microsoft Excel

    other thing you had mentioned that the file size get changed. I think that it is because you remove the macro from the file. so file size get changed.

    also let me know , if I misunderstand something in your above description.

    I will try to correct myself and try to provide you further suggestions.

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Regards

    Deepak 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 15, 2017 6:29 AM
    Moderator