I have code (written in c#) and a compiled .exe file, but in order to load in onto a board I need a .hex and a .dat file. Is there any way I can get these files from what I have, if so how? Thanks
Indeed - and, in particular, a sencence on this forum!
This is the Keil forum; it is for discussing Keil products - see: http://www.keil.com/forum/
C# is specifically a Microsoft language, for use in its .net frameworks - it has nothing to do with Keil!
You don't compile C# to a hex file - you build a so-called "assembly" which you then load into a suitable .net framework system.
Note that "assembly" here is nothing at all to do with the Assemblers or assembly languages supported by Keil!