Excel in SharePoint and "File is Corrupt" Error

This issue has caught me out several times – but if you’re using Excel on the SharePoint server – which is common during development – you need to turn off the protected views in the ‘Trust Center’ settings of Excel:

I’ve been set straight on this issue at least twice thanks to this post by JOPX. Unless those protected views are turned off then if you download the file you will only be told the file is corrupt – even if you can download the file and open it without any problem.

Excel in SharePoint and "File is Corrupt" Error

SharePoint: Check-Out vs Lock

I had been asked to look at a SharePoint event receiver that wasn’t behaving as it should. After a document had been checked in, it would set a property and update the item. However, we were getting an error:

SPException: The file “[File Name]” is locked for exclusive use by [User]

This was unfortunate – the user was the user who’d just been making changes, and the code was running after the document had been checked in – so what gives? Well, it turns out that the message is right – the file is locked, not checked out, and a lock is not the same as a check-out.
Continue reading “SharePoint: Check-Out vs Lock”

SharePoint: Check-Out vs Lock

Getting and Setting Properties in SharePoint

In SharePoint there are “property bags” on many elements of the system. For example, SPWebs and SPFolders have them, and methods like GetProperty() and SetProperty() to set them.

These methods accept and return objects. However, it’s nice to get values back in the same form as they were set. Continue reading “Getting and Setting Properties in SharePoint”

Getting and Setting Properties in SharePoint

Office 365 SharePoint – Higher level observations

Previously I’ve discussed some of the technical observations I made while working with Office 365. I’ve also noticed some ‘higher-level’ features of the project, and some discussions we’ve had about other opportunities. Here are some the the things that might well need addressed… Continue reading “Office 365 SharePoint – Higher level observations”

Office 365 SharePoint – Higher level observations

Office 365 – Technical observations from a first project

Recently I’ve been working on an Office 365 based SharePoint solution. It’s a system to allow a company to create sites to collaborate with their customers, and I learnt some interesting things on the way. In part 1 I’ll deal with the technical side of things, and in part 2 I’ll look at more ‘project’ level observations. Continue reading “Office 365 – Technical observations from a first project”

Office 365 – Technical observations from a first project

Dealing with Large Lists Part 3 – The ContentIterator

In Part 1 we looked at the problem of the query throttle in SharePoint 2010, and in Part 2 we looked at some of the ways of getting around that. In this part, though, we’ll look at what I think is the best way – the ContentIterator control. Continue reading “Dealing with Large Lists Part 3 – The ContentIterator”

Dealing with Large Lists Part 3 – The ContentIterator

Dealing with Large Lists Part 2 – Coping with large queries

In Part 1 we looked at what throttling was, why queries could be throttled, the settings that control throttling, and some of the references to other useful information. In this post we’ll look at ways of trying to get your query to run anyway, depsite the throttle. “Writing Efficient Code In SharePoint Server” is a good introduction to the general principles. Continue reading “Dealing with Large Lists Part 2 – Coping with large queries”

Dealing with Large Lists Part 2 – Coping with large queries