• Tag Archives Opening Documents in the Browser
  • Open Documents in Client Applications

    Recently, I had a situation where end users were trying to open Office files in the new SharePoint 2010 environment we released to them for testing. They would try to open an xlsx spreadsheet and it would try to open in the browser. We didn’t want this functionality to work so we decided to turn on the feature called “Open Documents in Client Applications by Default” at the site collection level. Which was suppose to automatically disable that functionality.

     

    Unfortunately, it didn’t work. I learned shortly after, that there is a setting (that enabling the said feature was suppose to take care of and didn’t switch for me)…

    I’m sure like most of you, your environment(s) have a ton of sites and within each, tons of document libraries. Going through them each and manually setting this, would be out of the question. So I took the approach of PowerShell. It had performed miracles for me in the past, no reason it wouldn’t now. Or so I hoped. I’m no PS guru by any means. So I rely on Google to help me out. After some time I came across a couple scripts that looked like viable solutions. But they failed me. After a couple days of troubleshooting, I finally came up with a solution that actually worked…


    #Get the site collection...
    $site=Get-SPSite "http://servername/sitecollection"
    $web=$site.RootWeb


    #Define the list type within the sitecollection to change (SPDocumentLibrary)
    #This changes the setting for all matching list types within the sitecollection
    foreach ($list in ($web.Lists | ? {$_ -is [Microsoft.SharePoint.SPDocumentLibrary]}))


    #define the setting and the value to modify.
    #You can define as many different settings as you like
    {
    $list.DefaultItemOpen = "PreferClient”
    $list.Update()
    }
    $web.Dispose()

    _________________________________________________________________________________________

    I did have a situation where even after this was adjusted, a small handful of end users were still getting SharePoint to open Excel documents in the browser somehow. Their configuration was Windows 7 (both 64 & x86), IE 8 and Office 2010. I couldn't entirely isolate what the cause was of the issue, but what I do know is that these guys were always tinkering with their OS/applications/registry. So who knows what caused it. The fix below seemed to resolve it:

    On each of SP servers in the farm go to:

    1. c$program filescommon filesMicrosoft SharedWeb Server Extensions14TEMPLATEXML.
    2.  Locate the file called “serverfilesExcelServer.xml”
    3. Comment out the xlsx file extension reference
    4. Perform an IISReset on each of the servers you made the change on.