I actually had to write a program that would automatically generate excel spreadsheets and graphs programmatically and it took forever to track down the documentation needed to do this. Although that doesn't sound like what you are doing it will get you in the right direction.
You should start looking into excel interop:
This will show you how to create one from a C# program. But you can also use it to modify an existing spreadsheet I believe.
I hope this helps!