Solution to Excel’s Application.Workbooks.Open returns null

We’ve written a solution to use excel installed on a server, to process spreadsheets and update a database.

A problem we ran into was, on calling Application.Workbooks.Open, a null value was returned.

This was on Windows Server 2008 64 bit, with Excel 2007 installed.

After alot of investigation, we created a new application pool, which we setup to use a named domain account, which we made a local administrator.

We also created the folder ‘Desktop’ in:

C:\Windows\SysWOW64\config\systemprofile\
& C:\Windows\System32\config\systemprofile\

This resolved the problem for us.

Clearly the local administrator solution avoided security with dcom, so if you didn’t want to use this approach you could grant permissions to the Excel Application directly to the named user, and that should resolve the problem too.

Here is a link to the article which helped me the most:

http://bytes.com/topic/c-sharp/answers/819740-c-service-excel-application-workbooks-open-fails-when-called-service

Leave a Reply

Marquee Insights

Tips and tricks for SharePoint 2007 and above

harbar.net

Tips and tricks for SharePoint 2007 and above

2toLead

You will love the way we work. Together.

Which Tool When

Tips and tricks for SharePoint 2007 and above