I have a requirement from a business user that I don't know how to address. The question is this:

Can I count the number of times a specific value appears inside the spreadsheets stored in a SharePoint (MOSS Enterprise) document library? There are hundreds of complex spreadsheets in the library and the user wants to count the instances of a specific value in all spreadsheets stored in the library.

I can do all of the analytics that the user likes on the library metadata but I don't know where to start with this one. Thoughts?

1 Answer 1


(Development required): You're gonna have to use Office Interop, combined with the Find method. How exactly you do this is up to you. If you have a lot of files, the process could be time consuming, so one method is to create an application page that has a control on it. The control accepts the target library you want to search (dropdown box, populated with libraries in the current web?) and the search string to look for, then, inside a SPLongOperation, iterates over the files in the library and performs the Excel Interop Find method, collecting the results as it goes, and presents the results once the Long Operation has finished.

  • Ouch... I should probably have specified "no code" but subsequent research is showing me that your suggestion seems to be the only one out there. Will let the question marinate for a bit longer before marking Answered but at least you've given me a thread to follow... thanks! Dec 19, 2011 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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