Click here to Skip to main content
15,065,044 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

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.
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)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900