Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Retrieve code from a busted macro? (2000)

    Hey all, I've been working on a huge macro project, dozens of userforms, etc. I've backed it up at several stages in my progress. One day, I finally finished and I left it at that. For some reason however, I come back to it today, and it crashes Excel as soon as I open the sheet, . Is there a way I can retrieve my code from the xls without Excel? Illegal Operation, Invalid Page fault as soon as I start up. Even if I disable macros!

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Retrieve code from a busted macro? (2000)

    Hi Kevin

    OK I am sorry but this is not pretty:

    1) Open MS-Excel.
    2) Open the VBE.
    3) Open the workbook in question and when it asks you if you want to run the macros say No.
    4) Goto the VBE and check the code and export it.

    It will help if you clean up the code as you go along. Plus if you are having trouble opeing this workbook, I guess you will need to restore a backup...

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retrieve code from a busted macro? (2000)

    Wassim, thanks for the reply and thanks for your help in the past. Unfortunately, when I hit "Disable Macros", Excel crashes. I guess I have to rewrite a lot of code! This teaches me to back up often!

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Retrieve code from a busted macro? (2000)

    Before you give up try opening the file on a different PC, and see if the problem persists. Also as a last resort try opening the file file whilst you hold down the Shift key.

    If you do manage to open the file on a different setup, you could export the modules and then import them to a new project.

    Andrew C

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retrieve code from a busted macro? (2000)

    You might try opening up your worksheet from IE. It worked for me once- but not again after.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  6. #6
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retrieve code from a busted macro? (2000)

    <P ID="edit" class=small>Edited by MichaelRead on 17-Sep-01 21:48.</P>You might also try the following:

    Delete your files from the WindowsTemp directory.

    This might help clear up your problem, but I cannot guarantee it. It has worked for me in the past, every time, without causing problems with other programs. I cannot guarantee it will work with your system.

    Actually, it has sometimes solved my problem, but it has never caused another program on my system to not function.

  7. #7
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retrieve code from a busted macro? (2000)

    Everybody, thanks for your input! Thanks Geoff, the opening in IE did the trick and I've recovered my forms. I'm going to stay away from Auto_Open for a little while until I can figure out what happened.

  8. #8
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retrieve code from a busted macro? (2000)

    Kevin,

    I'm glad that worked.

    I've had thatv happon randomly- but once a spreadsheet gets corrupted, it can be very hard to get straight again.

    Now you have your macros, copy the worksheets and macros into a new spreadsheet.

    And take regular backups <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •