The whole point of ratatouille is that it's gently simmered in olive oil until the veg merge into a lovely whole while still being identifiable. Do it in the oven if you like but it will be roast veg rather than ratatouille.
thank you both but I was wanting to do it in a pan,I've tried a few times including leaving it stood with salt on and drying it but still it seems to go a bit slimy :(
It's just the nature of those veg Zoe, I'm not overly keen on aubergine myself whichever way it's cooked. I can tolerate courgettes.
I use delia smiths recipe for oven roasted ratatouille, it comes out much the same as one done in a pan on the hob, maybe slightly less sloppy, and I prefer it.
Try frying the aubergine and courgettes separately and in batches so that they pick up colour on all sides and don't sweat in the pan. Then add them to the onions and peppers before adding the tomatoes.