Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Excel VB.NET Errors , +
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
good
Please Sign up or sign in to vote.

Solution 3

You can see this research: Summarize C# Control Excel Skills[^]
  Permalink  
Rate this: bad
good
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....Smile | :)
  Permalink  
Comments
GiovanniGH at 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 at 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.

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



Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2014
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