+ Reply to Thread
Results 1 to 5 of 5

VBA code suddleny producing an error

  1. #1
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    VBA code suddleny producing an error

    Help..

    the code listed below, has been working for well over a year, as its the original code that was created when i developed my spreadsheet. Now i have been making improvments through out the year, but never had a problem.

    Please Login or Register  to view this content.
    Now when the code gets excuted, I am presented with a run time error, stating that the sheet im trying to alter is protected etc

    The line it then highlights is

    Please Login or Register  to view this content.
    The code does what its suppose to do i.e. insert a line from another sheet, then it produces the error, The active sheet is protected, but the sheet where the line comes from is no longer protected. Also I find that two of the cells within the line that is copied over, do not have there formulas in.

    Now i cant work out why this is happening, as its never had any problems before

    Any help or ideas why... ??

    G
    Last edited by drgogo; 04-16-2010 at 03:50 AM. Reason: Update, to save mess

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA code suddleny producing an error

    Are you sure the password is correct?
    Also, do you have any event code in the sheet?

    Finally, it will be easier to change your password if you store it in a variable:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: VBA code suddleny producing an error

    Hello

    yes the password is correct, its the same password for all sheets, as i said its the original code and has been working for well over a year.

    There is event code on that particular sheet, but i have never had a problem with this sheet before, it just seem to start happening

    The code on the sheet is as follows

    Please Login or Register  to view this content.
    But as i said, never had problems with this before, the row copies over, but with missing formula and the parent sheet does not protect it self again.

    Is there anything wrong witht he code it self..?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA code suddleny producing an error

    If you insert a row, the Change event will fire, and your change event reprotects the sheet. You'll need to disable events while inserting:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: VBA code suddleny producing an error

    Strange, that seems to clear the problem, had to rearrange a few other columns, but seems ok, Will have to test it a bit more.

    But still cant find out why it decided to stop working, as i said its been working fine, even witht eh event coding...?

    Bloody Mircosoft and excel .. lol

    thanks very much for the help

    G

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1