使用控制台应用程序exe在服务器上从ASP 2.0 C#代码运行宏 [英] Running a macro from ASP 2.0 C# code on server using console application exe

查看:80
本文介绍了使用控制台应用程序exe在服务器上从ASP 2.0 C#代码运行宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我希望使用ASP.NET 2.0和C#对宏执行Excel.我尝试使用互操作服务,并且能够在本地系统中执行,但无法在服务器中执行.然后,我创建了一个控制台应用程序以打开包含宏的excel,并且我再次能够在本地系统中完成操作,但不能在服务器中执行.问题是当我手动运行exe时(即通过双击),我能够看到正在执行的excel宏,但是当我尝试使用网站时,它却无法打开.欢迎任何对此的输入!

Hi All,
I wish to execute an excel with macros using ASP.NET 2.0 and C#. I tried using interop services and was able to execute in my local system but unable to do so in server. Then I created a console application to open the excel containing macros and again I was able to do in local system perfectly but not in server. The problem is when I run the exe manually (i.e by double clicking) I am able to see the excel macros being executed but when I try using website it just doesn''t opens. Any Input on this is welcome!

推荐答案

如果不查看所有宏代码(这可能是发生错误的地方),很难说.

但是,它在本地运行并在服务器上给出找不到文件错误"的事实使我认为您正在使用服务器中不存在的宏中的目录位置\路径字符串?

仔细检查您的宏代码,查看引用路径的所有位置,例如C:\ Some Path \ My Excel Documents \

您引用的路径在服务器上是否存在?进程在服务器上执行的安全上下文是否对该位置具有权限?
It''s difficult to say without seeing all of the Macro code (which is probably where the error is occurring)

However, the fact that it''s working locally and giving a ''file not found error'' on the server makes me think you are using directory locations \ path strings in the Macro that don''t exist on the server?

Double check your Macro code, look at all the places where you are referencing a path, e.g C:\Some Path\My Excel Documents\

Do the paths you reference exist on the server? Does the security context the process is executing under on the server have permission to the location?


这篇关于使用控制台应用程序exe在服务器上从ASP 2.0 C#代码运行宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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