Can anyone clarify how to write data to the PIC18F45K22 EEPROM? I created *.ihex dump file, added to my project, selected EEPROM library in the Library Manager.
I assume that you created the ihex file with help of EEPROM Editor. If you answered Yes to the question "Use this EEPROM definition in project?" then the ihex file is included in project's hex file (and visible in Project Manager in "EEPROM files").
Press Build and Program. The MikroProg Suite GUI appears. Press "Data" knobe" - Data Dump windows is empty (all cells are FF).
Press "Reload Hex". Data Dump window is filled with data from *.ihex file.
That would obviously be a quirk of mikroProg Suite if one had to reload hex file to see its contents though I don't see such behaviour for PIC18F45K22-based project (v. 2.51 of mikroProg Suite).
Press "Write", then "Read" - Data Dump windows is empty (all cells are FF).
Make sure that you have "Load/Save DATA" checked in mikroProg Suite and that in "Options" in "Advanced Options" group "Preserve DATA" checkbox is unchecked. As Strahinja suggested, "Data EEPROM Code Protection" needs to be disabled in Project Manager.