[SOLVED] Help with SPI library please

Your code:

int write_eeprom(byte waddress, byte wvalue) {

// take the SS pin low to select the chip:
  digitalWrite(SLAVESELECT,LOW);
  //  send in the address and value via SPI:
  SPI.transfer(WRITE_ENABLE);
  SPI.transfer(WRITE);

The datasheet:

Care must be taken to take the CS input high after the WREN instruction, as otherwise the Write Enable Latch will not be properly set.

You aren't doing that.