windows server 2008下无法用程序打开一个xls文件问题
2010-08-24 17:23
706 查看
今天,客户告诉我突然导入excel文件中的内容到文档中这个功能无法使用了,经仔细查看,后台报错如下:
Microsoft Office Excel: 不能取得类 Workbooks 的 Open 属性
下面是我的代码:
Set Exl=createObject("Excel.application")
Set Book=Exl.application.WorkBooks.open(path$)
Call CreateDoc(Book,db)
服务器现实环境变化:服务器操作系统由原来的windows server 2003 换成windows server 2008 64位。
分析:
服务器上已经安装了office2003,因为该功能是最近不正常的,之前的office版本也是2003,所以不会存在office版本的问题。
经测试,导出excel的功能正常,即Set excelWorkbook = excelApplication.Workbooks.Add Set excelSheet = excelWorkbook.Worksheets("Sheet1")这段代码运行正常,只是找不到Workbooks的open属性而已。
怀疑是权限问题,2008的server版本对权限控制加强,但却无从下手。
后来经不断查找资料,看到这样一份信息:
・Windows 2008 Server x64
Please make this folder.
C:\Windows\SysWOW64\config\systemprofile\Desktop
・Windows 2008 Server x86
Please make this folder.
C:\Windows\System32\config\systemprofile\Desktop
...instead of dcomcnfg.exe.
This operation took away office automation problems in my system.
A Desktop folder seems to be necessary in the systemprofile folder to open file by Excel.
It disappears from Windows2008, Windows2003 had the folder,
and I think it cause this error.
经过以上处理,问题虽然得带解决,但是为什么在 系统盘(C):\Windows\SysWOW64\config\systemprofile\目录下创建名为Desktop目录即可解决问题,仍然不是很清楚。继续查了一些资料,个人认为应该还是权限的问题,希望有高手能够为我解答下这个疑问。
虽然最终原理不是很清楚,但至少解决了问题,留下解决方法,希望对大家有点帮助。
Microsoft Office Excel: 不能取得类 Workbooks 的 Open 属性
下面是我的代码:
Set Exl=createObject("Excel.application")
Set Book=Exl.application.WorkBooks.open(path$)
Call CreateDoc(Book,db)
服务器现实环境变化:服务器操作系统由原来的windows server 2003 换成windows server 2008 64位。
分析:
服务器上已经安装了office2003,因为该功能是最近不正常的,之前的office版本也是2003,所以不会存在office版本的问题。
经测试,导出excel的功能正常,即Set excelWorkbook = excelApplication.Workbooks.Add Set excelSheet = excelWorkbook.Worksheets("Sheet1")这段代码运行正常,只是找不到Workbooks的open属性而已。
怀疑是权限问题,2008的server版本对权限控制加强,但却无从下手。
后来经不断查找资料,看到这样一份信息:
・Windows 2008 Server x64
Please make this folder.
C:\Windows\SysWOW64\config\systemprofile\Desktop
・Windows 2008 Server x86
Please make this folder.
C:\Windows\System32\config\systemprofile\Desktop
...instead of dcomcnfg.exe.
This operation took away office automation problems in my system.
A Desktop folder seems to be necessary in the systemprofile folder to open file by Excel.
It disappears from Windows2008, Windows2003 had the folder,
and I think it cause this error.
经过以上处理,问题虽然得带解决,但是为什么在 系统盘(C):\Windows\SysWOW64\config\systemprofile\目录下创建名为Desktop目录即可解决问题,仍然不是很清楚。继续查了一些资料,个人认为应该还是权限的问题,希望有高手能够为我解答下这个疑问。
虽然最终原理不是很清楚,但至少解决了问题,留下解决方法,希望对大家有点帮助。
相关文章推荐
- [转]Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- [转]Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- [转]Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- [转]Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- Win7、Windows Server 2008下无法在Windows Service中打开一个已经存在的Excel 2007文件问题的解决方案
- visual studio 2008安装出现"无法打开数据文件问题"
- windows server 2008下双击txt文件用记事本打开自动打印的问题解决
- 【问题】无法查找或打开 PDB 文件【win32程序调试】
- Office 检测到一个与此文件相关的问题为帮助保护您的计算机,无法打开此文件。
- 一个由于文件权限问题导致的SQL Server 2008 无法正常启动的问题
- 多个文件合并成一个大文件后,无法打开,需要从以下几个方面找出问题?
- error C1041: 无法打开程序数据库“xxx\vc140.pdb”;如果要将多个 CL.EXE 写入同一个 .PDB 文件,请使用
- c# 读取其他程序正打开的文件的时“正由另一进程使用,因此该进程无法访问该文件。"的问题解决方法
- 关于双击cpp文件无法直接打开,VS2008提示“向程序发送命令时出现问题”的解决
- 无法查找或打开 PDB 文件,测试程序无法得到结果-VS 中配置OpenCV的问题