I think you need to get your terminology straight.
PKHeX is a PC executable program that edits save files. Save files stores the progress of your Pokemon games.
Commonly known ways to extract saves files from your games can be, and not limited too, TWL save tool, Checkpoint, JKSM etc.
The above contains various examples of save dumping programs.
Once you obtain your save file, drag that into PKHeX (you know, the program on your computer). There is no point dragging a PC program into a save dumping program and expect good things to happen.
Main gist:
1. Play Pokemon game
2. Extract the save file
3. Transfer the save file to PC.
4. Have PKHeX modify the save file
5. Restore the edited save file into the game.
6. Play the game with the edited save.