SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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 have multiple SPGridViews on a page. I would like to export them all to one Excel document, each SPGridView on its own tab. Is this possible?

This link is a great start but does not solve my tab issue.

share|improve this question

You can write your own custom export logic by using the COM Interop libraries. The class is Microsoft.Office.Interop.Excel. You probably have to download the MSO Interop pack unless you already have it. Just make sure to get the right Interop libraries for the version of Excel you're targeting.

Tabs are Worksheet objects. The Excel document is the Workbook object.

Here's the link to the class library on MSDN:

share|improve this answer
Thank you for your suggestion! However I would love to avoid completely rewriting this solution if possible. – James Grizzle Sep 13 '12 at 19:57
Well, let me know if you figure it out a different way, or just post it as an answer. – RJ Cuthbertson Sep 14 '12 at 2:15
up vote 0 down vote accepted

I decided to go the OpenXML route.

share|improve this answer

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.