Results 1 to 5 of 5

Thread: Insert method of Range class failed

  1. #1

    Insert method of Range class failed



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Here is the macro:
    Code:
    'make sure the current sheet is active
        Worksheets("Sheet1").Activate
        'select the previously named cell
        Range("NF_Totals").Select
        'insert a new row above the selected cell
        ActiveCell.EntireRow.Insert  <<<<<<< -------------------- offending line
        'move to the formula cell in the row above the new row
        Range("NF_Totals").Offset(-2, 9).Select
        'copy the contents of that cell
        Selection.Copy
        'Move to the place to copy the formula into the new row
        Range("NF_Totals").Offset(-1, 9).Select
        'paste the formula into the new cell
        ActiveSheet.Paste
        'select the cell at the start of the new row
        Range("NF_Totals").Offset(-1, -1).Select
        'send ESC as if from the keyboard to remove the dashed marking from the copy command
        Application.SendKeys "{ESC}"

    The error code was :

    Run-time error '1004':

    Insert method of Range class failed

    This worked yesterday and this morning. One thing I did was add a digital certificate to sign this Excel worksheet and now this.
    What am i missing?? This was a little project to help the wife. Needed the Digital Certificate to get around the security settings at her work.
    Last edited by Zack Barresse; 2012-03-04 at 08:05 AM. Reason: Added CODE tags.

  2. #2
    Conjurer Simi's Avatar
    Join Date
    Feb 2012
    Location
    Utah, USA
    Posts
    187
    Articles
    0
    I was looking into using digital certificates today. From what I was reading the self signed certs only work on the same computer that the cert was created. If it was working before the cert was put on, I would have to say that is what is keeping it from working now.

  3. #3
    I was using the same system that was used to create the macros. The file is in the same folder as originally.

  4. #4
    Super Moderator Zack Barresse's Avatar
    Join Date
    Mar 2011
    Location
    Oregon, United States
    Posts
    106
    Articles
    0
    Just out of curiosity, as I don't use DC's but i know some people who have, did you edit or compile your code after the certificate was issued? Also, did you go and add it as a trusted publisher on your wife's computer? I'm not the best with these, but I know they are very finicky.

    Zack
    Sent from my mobile using Tapatalk
    Regards,
    Zack Barresse

  5. #5
    The problem is ME! Somehow I knew it would be. I protected the worksheet to stop my wife from making any unwanted changes. Evidently I did all my testing before I applied protection. Just unprotected the sheet and of course all is well. A little rest from this and I found the culprit first thing this morning. I can't believe I did that. Thanks for the replies. Have a great day.

Tags for this Thread

Posting Permissions

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