none
Can I retrieve the VBA project from a corrupt MS Project .mpp file? RRS feed

  • Question

  • Hi,

    I have a MS Project file (2010 .mpp format) with many VBA procedures, user forms, etc.  The file has corrupted itself somehow and now I cannot open it at all.  I'm not worried about the plan data in the file - there was not much anyway, but is it possible to extract the code from the VBA project so that I can re-build it?

    Thanks

    • Moved by Mike Feng Tuesday, December 27, 2011 9:59 AM VBA (From:Visual Basic General)
    Friday, December 23, 2011 5:32 PM

Answers

All replies

  • Depends on whether the file can be opened at all.

    You could try using a hex editor (such as HxD) to see if the file can be opened and the contents viewed. If so then it may be possible to retrieve the text that makes up your code. I don't know anything about the format of mpp files so can't offer specific help.

    Of course you could always revert to the backup. You do have backups I assume. :)


    Regards David R
    ---------------------------------------------------------------
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.
    Friday, December 23, 2011 6:15 PM
  • Thanks for the suggestions.

    The file won't open at all with MS Project - it just hangs.

    I've tried a hex editor (010) but the internal structure is too complicated to make sense out of what can be seen.  I think I need something that can unscramble the raw bits and bytes.

    MS Project has an automatic backup - that was corrupted too.

    Friday, December 23, 2011 6:27 PM
  • You could try using another reader e.g. this open source one it may be more forgiving.

    Since it is open source the source code should be available so that might tell you something about the structure - but that's a very long shot and one that might require more effort than it's worth.

    NOTE: it's not open source as its name implies but shareware according to some comments.


    Regards David R
    ---------------------------------------------------------------
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.
    • Edited by Riced Friday, December 23, 2011 6:52 PM Added NOTE
    Friday, December 23, 2011 6:49 PM
  • Ian,

    This forum is for questions about VB in Visual Studio Net. 

    For VBA is the ISSVBA form.

    http://social.msdn.microsoft.com/Forums/en-US/isvvba


    Success
    Cor
    Friday, December 23, 2011 7:27 PM
  • There are two distinct aspects to MS Project 1) the planning data based on an internal MS proprietary database and 2) the VBA project which contains MS Forms and all the related code.  All the MS Project readers only look at the data related to the plan, not the VBA project itself.  It's the code that I want to access, not the planning data.

    Friday, December 23, 2011 7:29 PM
  • Hi IanB1954,

     

    Maybe this thread will help you how to handle corrupted Project files:

    http://project.mvps.org/faqs.htm#Handling_project_file_corruption_and/or_bloat

     

    Hope this helps,

     


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Thursday, January 12, 2012 3:25 AM
    Moderator