programmer not responding when loading a sketch

My sketch blinks one of 253 LEDs in an 11-row, 23-column matrix.
The sketch compiles ok.
When I try to load the sketch into my Uno, it works once or twice
and after that I get the error message: avrdude: stk500_recv(): programmer is not responding
as if my sketch broke some hardware on the Uno board.
I tried another Uno and the same thing happens.
Does anyone have an idea of what is happening and how to fix it? Thanks,
Jim

/*This program selects a random LED column and a random LED row of a 23 x 11 matrix
 of LEDs and blinks the intersecting LED.
 Then the loop repeats and another random row-col LED is blinked.  */

// define pin numbers:
int ButtonPin = 2; // pushbutton pin
int RowPinA = 13;  //These Arduino output pins go to a 74150 4x16 
int RowPinB = 12;  //demux device to select 1 of 11 rows in the 
int RowPinC = 11;  //LED matrix.
int RowPinD = 10;
int ColPinE = 9;   // MUX device decoder: 0-enable Mux0 (Col 1-15), 1-enable Mux1
int ColPinF = 8;   //These Arduino output pins go to a pair of 74150
int ColPinG = 7;   //4x16 demux devices to select 1 of 23 columns in
int ColPinH = 6;   //the LED matrix.
int ColPinI = 5;
int Delayt1 = 10;  // delay used for ???
boolean DiagnosticsOn = true; //used to turn on/off serial monitor data
//int ButtonState = LOW; // variable for reading the pushbutton status LOW or
//int OldButtonState = LOW; //HIGH. Pushbutton sequences through display modes.
//int PushNum = 0; //initialize button push number
//int MaxPushNum = 8; // set max number of button pushes before starting over

void setup() {
  Serial.begin(9600); // start serial monitoring at 9600 baud
  pinMode(RowPinA, OUTPUT); // Set LED pins as outputs
  pinMode(RowPinB, OUTPUT);
  pinMode(RowPinC, OUTPUT);
  pinMode(RowPinD, OUTPUT);
  pinMode(ColPinE, OUTPUT); //Column DEMUX-select
  pinMode(ColPinF, OUTPUT);
  pinMode(ColPinG, OUTPUT);
  pinMode(ColPinH, OUTPUT);
  pinMode(ColPinI, OUTPUT); 
}
// pinMode(ButtonPin, INPUT); // Set pushbutton pin as an input
void loop()
{
  // int ButtonState = digitalRead(ButtonPin); // read pushbutton press state
  // delay(20);
  // if ((ButtonState == HIGH) && (OldButtonState == LOW)) {
  // PushNum = PushNum + 1; }
  // if (PushNum > MaxPushNum) {
  // PushNum = 1; } //reset PushNum to 1 if > MaxPushNum
  // if (PushNum == 1)} { // go to function RowSelection
  // RowSelection(); }
  // OldButtonState = ButtonState; }

  // void RowSelection {
  int Row = random(1,12); //selects a row from 1 through 11 //byte type = 0-255
  int Col = random(1,24); //selects a column from 1 through 23

  if (DiagnosticsOn) {
    Serial.print("Row "); //Display row and column in monitor window
    Serial.print(Row);
    Serial.print("    Col ");
    Serial.println(Col);
    delay(10);
  }

  //Activate Row 1-11 output pins
  if (Row >= 1 && Row <= 7) {
    RowPinD = 0; 
    digitalWrite (RowPinD, LOW);   
  }
  else {
    RowPinD = 1; 
    digitalWrite (RowPinD, HIGH);  
  }
  if (Row == 1||Row == 2||Row == 3||Row == 8||Row == 9||Row ==10||Row == 11) {
    //if (Row >= 1 && Row <= 3) || (Row >= 8 && Row <= 11) {
    RowPinC = 0;
    digitalWrite (RowPinC, LOW); 
  }
  else {
    RowPinC = 1;
    delay(10);
    digitalWrite (RowPinC, HIGH); 
  }
  if (Row == 1 || Row == 4 || Row == 5 || Row == 8 || Row == 9) {
    RowPinB = 0; 
    digitalWrite (RowPinB, LOW);  
  }
  else {
    RowPinB == 1;
    digitalWrite (RowPinB, HIGH); 
  }
  if (Row % 2 == 0) {
    RowPinA = 0; 
    digitalWrite (RowPinA, LOW); 
  }
  else {
    RowPinA = 1;
    digitalWrite (RowPinA, HIGH);  
  }

  //void ColSelection1-15()  {
  //Activate Column output pins for columns 1 through 15
  if (Col >= 1 && Col <= 15) { // make While loop?
    ColPinE = 0;  
  }               //ColPinE controls column demux devices: 0 - MUX 0; 1 - MUX 1

  if (DiagnosticsOn) {
    Serial.println("MUX 0");   // MUX0 selects columns 1-15; MUX1 - Col 16-23
    delay(10);  
  }

  if (Col >= 1 && Col <= 7) { 
    ColPinI = 0;
    digitalWrite (ColPinI, LOW); 
  }  
  else {
    ColPinI = 1;
    digitalWrite (ColPinI, HIGH); 
  }
  if (Col == 1||Col == 2||Col == 3||Col == 8||Col == 9||Col == 10||Col == 11) {
    //if ((Col >= 1) && (Col <= 3)) || ((Col >= 8) && (Col <= 11)) {
    ColPinH = 0;
    digitalWrite (ColPinH, LOW); 
  }
  else {
    ColPinH = 1;
    digitalWrite (ColPinH, HIGH); 
  }
  if (Col == 1 || Col == 4 || Col == 5 || Col == 8 || Col == 9 || Col == 12 || Col == 13) {
    ColPinG = 0;
    digitalWrite (ColPinG, LOW); 
  }
  else {
    ColPinG = 1;
    digitalWrite (ColPinG, HIGH); 
  }
  if (Col % 2 == 0) {
    ColPinF = 0;
    digitalWrite (ColPinF, LOW); 
  }
  else {
    ColPinF = 1;
    digitalWrite (ColPinF, HIGH); 
  }

  //Activate Column output pins for columns 16 through 23
  if (Col >= 16 && Col <= 23) {  // make While loop?
    ColPinE = 1;  
  }         //ColPinE controls column MUX devices: 0 - MUX 0; 1 - MUX 1

    if (DiagnosticsOn) {
    Serial.println("MUX 1");   // MUX0 selects columns 1-15; MUX1 - Col 16-23
    delay(10); 
  }

  //void ColSelection16-23()  {
  if (Col >= 16 && Col <= 23) {
    ColPinI = 0;
    digitalWrite (ColPinI, LOW); 
  }  // MUX0 selects columns 1-15; MUX1 - Col 16-23
  else {
    ColPinI = 1;
    digitalWrite (ColPinI, HIGH); 
  }
  //if (Col == 16 || Col == 17 ||Col == 18 || Col == 23) {
  if (Col >= 16 && Col <= 19) {
    ColPinH = 0;
    digitalWrite (ColPinH, LOW); 
  }
  else {
    ColPinH = 1;
    digitalWrite (ColPinH, HIGH); 
  }
  if (Col == 16 || Col == 17 || Col == 20 || Col == 21) {
    ColPinG = 0;
    digitalWrite (ColPinG, LOW); 
  }
  else { 
    ColPinG = 1;
    digitalWrite (ColPinG, HIGH); 
  }
  if (Col % 2 == 0 ) {
    ColPinF = 0;
    digitalWrite (ColPinF, LOW);
  }
  else {
    ColPinF = 1;
    digitalWrite (ColPinF, HIGH);
  }

  if (DiagnosticsOn) {
    Serial.print("DCBA = ");
    Serial.print(RowPinD);
    Serial.print(RowPinC);
    Serial.print(RowPinB);
    Serial.print(RowPinA); 
  }
}

If your LED matrix is not connected to the Uno do you have upload problems?

Thanks for responding. I am attempting to load a sketch without the LED matrix connected to the Uno.