Share via

Runtime error 57121

Anonymous
2015-10-17T20:08:04+00:00

Hi! Guys!

Has anyone come up with the solution regarding this error?? Please help this is really disgusting. An Excel file has been running so well for years since 2002 now is generating this error after upgrading from Excel 2003 to 2007. I tried installing 2010 and 2013 but still I get same problem. Please help.

The error pops out its ugly head on the below line of code:

 With Application.Thisworkbook.Worksheets("General Stock")

    .Activate

    .EnableSelection = xlNoSelection

    .Protect Password:="StringPassword"

End With

The error pops out its ugly head on .Activate function of the worksheet.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2015-10-20T17:09:43+00:00

Hi! OssieMac,

I just upgraded from windows 7 to windows 8, I re-installed office 2013 and KABOOM!!! To my surprise, all my Excel files are up running perfectly well and just as they had normally and usually been running.

Wow!!

Warm regards,

S. T. S.

Woooohooooo!!!!!

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2015-10-19T08:15:14+00:00

    OssieMac,

    Thanks a lot for your prompt reply. Yeah it is kind of weird getting errors poping out on common Excel Worksheet functions. I checked actually on References but there is none that is showing as a missing reference. I actually did that before I went googling around. I also get errors on functions like:

        Worksheet.EnableSelection

        Worksheet.Protect Password:=myPassword

    These are functions that you do not have to select any references, they automatically appear with Excel.

    Anyway thanks a lot for your help I really appreciate so much. I'll just try some work arounds and see if I could get through.

    Regards,

    STS.

    Was this answer helpful?

    0 comments No comments
  2. OssieMac 48,001 Reputation points Volunteer Moderator
    2015-10-17T20:57:42+00:00

    Code works fine for me in Excel 2010.

    I don't know if the following will help but worth a look because you have upgraded the Excel version.

    In the VBA editor Select menu item Tools -> References.

    Check that you do not have any missing references. (It will show "MISSING REFERENCE" at the beginning of the reference name.)

    If any missing references then uncheck the box against them and then scroll down and find the equivalent reference and check the box against it.

    Missing References causes errors that one would not expect. eg I had one only yesterday that failed with Trim function and I would not have thought that the missing reference had anything to do with it.

    Was this answer helpful?

    0 comments No comments