Consulting

Results 1 to 3 of 3

Thread: Please Help - Stupid Mistake

  1. #1
    VBAX Newbie
    Joined
    Apr 2012
    Posts
    1
    Location

    Please Help - Stupid Mistake

    Hi I accidently copied code from one section to the wrong section of my Excel UserForm. I wrote some code that would save the Excel Sheet then close the work book that I wanted to put inside a button click. I accidently copied it into the UserForm close event. So now When I open my excel file to try to finish up the form, I can no longer get to the Developers tab b/c the UserForm is opened and If i close the UserForm it closes my workbook. SO i am stuck in a cirlce and I am not sure how to correct this. Does any have any suggestions that might help? Is there a way to edit the code outside of Excel. Or get excel to open the work book but not open the user form even though the code tells it to open?

  2. #2
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    When opening a file, hold the shift down should stop the macro from running.

    Or Ctrl-Break will stop the macro.

    David


  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    1. When you open the WB, if you get the prompt to "Enable Macros" ... don't

    or 2. Go to Start, Run and open Excel in Safe Mode

    > <path> Excel.exe /safe

    http://www.cpearson.com/excel/StartupErrors.aspx

    Good luck

    Paul

Posting Permissions

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