I used to have quite bad social anxiety and fear of crowded places so much so I couldn't cope on a crowded bus without freaking out. Its calmed down a lot over the last few years but I still can't cope around large crowds.

I have just been "invited" to the work Christmas party where there will be over a hundred people. I have essentially been told I have to go. I don't know what to do I have had panic attacks in crowded rooms. Last time we had a work do I didn't go and was pretty much told its not good enough.

You should go to the organizer or boss in person and explain your problem, it is always nice to get together socially but certainly should not be compulsory, an alternative would be to go to the beginning, the meal for example. The "not good enough" comment was clumsy and thoughtless, by someone who thought you could not be bothered but do remember the firm had gone to time and effort to arrange it, so do give your apologies and explain why.