- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我的代码如下:-
Microsoft.Office.Interop.Excel.Application oXL = null;
Microsoft.Office.Interop.Excel.Sheets sheets;
Application excel = new Microsoft.Office.Interop.Excel.Application();
excel.Workbooks.Add(System.Reflection.Missing.Value);
/*
* Here is the complete detail's about Workbook.Open()
*
* Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format,
* Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin,
* Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad)
*/
Workbook workbook = excel.Workbooks.Open(
System.Web.HttpContext.Current.Server.MapPath("~/App_Data/Template.xlsx"),
Missing.Value, true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value);
sheets = workbook.Worksheets;
现在该行:-
workbook = excel.Workbooks.Open(
System.Web.HttpContext.Current.Server.MapPath("~/App_Data/Template.xlsx"),
Missing.Value, true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value);
它直接从 visual studio (F5) 执行,但是当我尝试使用 IIS 访问它时,它不起作用。抛出错误如下:-
Microsoft Office Excel cannot access the file 'c:\inetpub\wwwroot\Timesheet\App_Data\Template.xlsx'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
我已经尝试过解决方法:-
- Folder and the file exist, giving access to the IUSR_### (IIS user) and to the ASPNET user in the folder where the file is.
- At Component Services(DCOM) given access to appropriate user.
我已经授予模板(.xlsx)所在文件夹的所有权限
有什么建议吗??
最佳答案
试试这个:
C:\Windows\SysWOW64\config\systemprofile\Desktop
(对于 64 位 Windows 计算机上的 32 位版本的 Excel/Office)或
C:\Windows\System32\config\systemprofile\Desktop
(对于 32 位 Windows 计算机上的 32 位版本的 Office 或 64 位 Windows 计算机上的 64 位版本的 Office)。
带答案的原帖:
关于c# - Microsoft Office Excel 无法访问文件 'c:\inetpub\wwwroot\Timesheet\App_Data\Template.xlsx',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7106381/
有谁知道删除 InetPub 文件夹是否会损害 IIS 或任何相关内容? 我正在使用 IIS 7。 最佳答案 IIS 将再次创建它 AFAIK。 关于iis-7 - 删除 "InetPub"文件夹是否
IIS 6 及更早版本附带一个名为 ADSUTIL.VBS 的实用程序脚本。 : Adsutil.vbs is an IIS administration utility that uses Micr
在我的 Windows 7 计算机上,除非关闭用户帐户控制,否则 c:\inetpub\wwwroot 不可更新。这是怎么回事? 最佳答案 这里发生了两件事: 1) WWWROOT目录默认允许Admi
我在 ASP.NET 网页的代码隐藏中有一个函数,它创建一个文件,然后用 javascript 命令打开它。这在 IDE 中有效 - 它创建文件,询问我要保存文件的位置,我可以保存它等等 - 但是当我
我正在尝试在 Windows Server 2008 R2 上设置 IIS Web 服务和 ASP.NET 服务。物理目录已创建,但我无法使其工作。这是全新的 IIS 角色安装。 服务器位于域上,并且
我刚刚在 Windows XP 上安装了 IIS。 当我尝试执行应用程序时,出现错误: Access to the path 'c:\inetpub\wwwroot\myapp\App_Data' i
我已将发布的 ASP.NET 文件从 C:/xyz/mywebsite 到 c:/intepub/wwwroot/mywebsite。在网站的一项功能中,我们创建一个 txt 文件,然后在根文件夹中编
我创建了以下代码,但它没有给出我想要的实际结果。代码:- ServerManager manager = new ServerManager(); Site defaultSite = manag
我正在尝试将我们目前支持 Windows 2000 和 Windows 2003 的软件安装程序移植到 Windows 2008 环境中。目前,安装程序收到一条错误消息,内容为“错误 1606。无法访
花了一整天的时间来解决这个问题,有人可以解释一下我如何在 Windows 上安装 Laravel 吗? 我已经安装了最新版本的 PHP 5.4(使用 Windows Installer)并在一个简单的
我正在尝试查找未托管在正常 Inetpub\wwwroot 中的 Web 服务的文件路径。我想找到 Web 服务的版本来检查以确保 2 台 PC 具有与我现在所做的相同的版本,只要我确定确切的文件路径
您好,我一直在努力解决一个奇怪的问题。我正在使用 IIS 并将我的网站文件夹之一移动到我服务器的桌面,然后将其放回去,现在我明白了 Warning: include_once(./lib/config
我的代码如下:- Microsoft.Office.Interop.Excel.Application oXL = null; Microsoft.Office.Interop.Excel.Sheet
在使用 soap 网络服务将数据传输到网络时出现以下错误。 envelope.setOutputSoapObject(request); httpTra
我是一名优秀的程序员,十分优秀!