I want to create a content type (programmaticall) which can be bound to excel instead of word, and add it to a List Library so when you click create new document it opens a excel template. thanks
You need to set the DocumentTemplate property.
You can create content type programmatically in FeatureActivated event. Refer to the link below, it can help you get started: