无法从VB2005打开Excel文件 [英] Cannot open Excel File from VB2005

查看:100
本文介绍了无法从VB2005打开Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助!!!

我在VB 2005中开发了一个程序,该程序可以使用Interop打开Excel文件,并使用xp_cmdshell从SQL存储过程中调用它.当我在Windows 2003 Server下工作时,一切正常.问题是,当我尝试以相同的方式但在Windows 2008 Server下调用程序时.当我的程序尝试打开Excel文件时,它会引发异常.我以为这是身份验证问题,所以我将SQL Server服务的登录名更改为管理员帐户,并通过Excel文件所在的文件夹将完全控制"权限授予了所有人,但问题仍然存在.

错误消息指出无法访问Excel文件,因为该文件正在被另一个程序使用(不是),或者用户没有足够的特权.

Windows 7下也会发生相同的问题.

有什么想法吗?

在此先感谢您的帮助.

Giovanni @ Guatemala.

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.

推荐答案

如果您在项目中使用Object lib 11.0,然后对其进行更改并使用"Microsoft Excel 12.0 Object Library",则可能会解决您的问题... .:)
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....:)


您可以看到以下研究:总结C#Control Excel技能 [ ^ ]
You can see this research: Summarize C# Control Excel Skills[^]


这篇关于无法从VB2005打开Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆