SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I will have a master excel file stored in one of the SP list. On the button click I have to create new excel file by reading master template and need to modify some cells and store new file in separate SP List.

Any help or guidance will be much appreciated..

share|improve this question

Get your master file using,

SPWeb.GetFile method

Then Copy it to create a new file using,

SPFile.CopyTo method (String)


Modify your newly Excel created file

share|improve this answer
Thanks Raja. Do I need to first copy the file into destination list and then open it and modify ? Can't I create first, then modify it and at the end copy to destination list ? – Rishi Apr 11 '13 at 16:42
You can do it both ways, I don't see any problem with that. – Muhammad Raja Apr 11 '13 at 17:42

For SharePoint 2010/2013 best option to manipulate Office files programatically, while not resorting to Automation/Interop and 3rd party components is OpenXML (

Basically this will help in scenarios where you need to perform more manipulation of the content starting from the actual Master template and even combining more business logic with data from SharePoint.

Alternativelly, using Excel Services could be also used ( however it would require ENterprise license.

share|improve this answer

You could create a content type with the master file as the template file. Then create a new document of that content type. VBA inside the Excel file can take care of setting values in cells and storing in a different library.

share|improve this answer
Thanks Teylyan, Actually my requirement is more complex than I have explained.The new excel file which must be created from master file will display information from the list document based on document selected so I'm afraid content type solution will work for me. – Rishi Apr 12 '13 at 13:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.