Insert method of Range class failed

Mainiac66

New member
Joined
Mar 2, 2012
Messages
3
Reaction score
0
Points
0
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 a moderator:
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.
 
I was using the same system that was used to create the macros. The file is in the same folder as originally.
 
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
 
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.
 
Back
Top