Click here to Skip to main content
12,949,601 members (70,911 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
Hi, I need help!!!

I developed a program in VB 2005 which opens an Excel file using Interop, and I call it from an SQL Stored Procedure using xp_cmdshell. Everything works fine when I am working under Windows 2003 Server. The problem is when I try to call my program the same way, but under Windows 2008 Server. It throws an exception at the moment my programs tries to open the Excel file. I assumed it was an authentication issue, so I changed the login for the SQL Server Service to an administrator account, and I gave Full Control to Everybody over the folder where the Excel file resides, but the problem persists.

The error message says that the Excel file cannot be accessed because either the file is in use by another program (which it isn't) or the user doesn't have enough privileges.

Same problem happens under Windows 7.

Any ideas?

Thanks in any advance for your help.

Giovanni @ Guatemala.
Posted 6-Feb-12 19:17pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

if u used Object lib 11.0 then change it and use "Microsoft Excel 12.0 Object Library" in your Project it may solve your problem....:)
GiovanniGH 7-Feb-12 16:02pm
I am using "Microsoft Excel 12.0 Object Library since the beginning of the project, but I can try with a newer version of the Excel Library... thing is, I don't know if there is any. But I will try. Thanks NikulDarji.
GiovanniGH 7-Feb-12 17:08pm
Nope, it has to be something else. I tried to run my program with a double click and it opened the Excel file with no problem. The problem is when I call my program from an SQL Server Stored Procedure using xp_cmdshell.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

You can see this research: Summarize C# Control Excel Skills[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,489
CHill60 3,380
Maciej Los 2,913
Jochen Arndt 1,935
ppolymorphe 1,820

Advertise | Privacy | Mobile
Web02 | 2.8.170524.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100