错误 1001 向应用程序发送命令时发生错误
COM Excel 插件、C#、VS2008 当我安装/卸载 AddIn 时,偶尔会发生该错误。 有时我会看到错误 1001 找不到指定的文件
有人知道导致这些问题的原因以及如何修复吗?谢谢,
我使用 Windows 安装程序
http://msdn。 microsoft.com/en-us/library/2w2fhwzz%28v=VS.90%29.aspx 表示如果使用 [TARGETDIR],它应该类似于“[TARGETDIR]\”或“[TARGETDIR]”。我只是在 CustomActionData
中使用 /filepath = "[TARGETDIR]myinstallfile" 我不明白的是它几乎一直有效,偶尔会失败 另外,即使我将其更改为包含空格或反斜杠,我也无法判断这是否可以解决问题,因为问题并非每次都会发生。有人有经验吗?谢谢
COM Excel AddIn, C#, VS2008
The error happens occasionally when I install/uninstall my AddIn.
sometimes I see Error 1001 the specified file can not be found
Anyone know what causes these and how to fix? thanks
I use windows installer
http://msdn.microsoft.com/en-us/library/2w2fhwzz%28v=VS.90%29.aspx says if use [TARGETDIR], it should be like "[TARGETDIR]\" or "[TARGETDIR] ". I simply use /filepath = "[TARGETDIR]myinstallfile" in CustomActionData
What I do not understand is it works almost all time and fails occasionally
Also even if I change this to including space or backslash, I can't tell if that fixes issue since the issue does not happen every time. Anyone has experience? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我发现了这个并且它解决了问题,尽管我不确定我是否在我的程序中使用过 DDE
http://sympmarc.com/2010/02/04/microsoft-excel-error-there-was-a-problem-sending-the-command-to-the-program/
I found this and it fixes the issue though I am not sure I ever use DDE in my program
http://sympmarc.com/2010/02/04/microsoft-excel-error-there-was-a-problem-sending-the-command-to-the-program/
然后我找到了这个 http://www.opendylan.org/documentation/opendylan/interop2 /inte_278.htm
它谈论 COM 服务器
所以我去cmd,输入“Excel.exe /RegServer”,然后错误消失了。
我真的不确定这个解决方案是否适用于所有情况。
事实上,我担心我错过了安装程序中的某些内容。
Then I found this http://www.opendylan.org/documentation/opendylan/interop2/inte_278.htm
It talks about COM Server
so I went to cmd, type in "Excel.exe /RegServer", then the error disappears.
I am not really not sure if this solution works for all cases.
In fact, I am concerned that I miss sth in installer.
这是 与您的问题非常相似的问题相关的 Microsoft 支持页面。所以对我来说,它看起来像是 Excel 中的错误,而不是安装程序中的错误。
这篇文章相当长,但归根结底是要确保:
除此之外,您可能会尝试修复 Excel安装或遵循 此 ASP.NET 论坛 修复 Excel 安装注册表。
我希望它可以帮助面临类似问题的人。
Here is a Microsoft Support page related to an issue which looks quite similar to yours. So for me it looks like a bug in Excel rather than in your installer.
The article is quite large, but it boils down to making sure that:
Other than that you might try to repair Excel installation or follow the advice given in this thread of ASP.NET forums to fix the registry for Excel installation.
I hope it helps someone facing similar issues.
如果您在卸载 VS 安装项目 MSI 时遇到此类错误,那么最可能的原因是在安装和卸载之间未保留 TARGETDIR,因此它没有任何价值,并且尝试在卸载自定义操作中使用它将会导致找不到该文件。最简单的解决方案(除了始终安装到已知位置(例如常见文件等)之外)是将 TARGETDIR 保存到注册表并稍后检索它。在 VS IDE 中,您可以创建一个值为 [TARGETDIR] 的注册表项,以便在安装时解析它。
If you get this type of error when uninstalling a VS setup project MSI, then the most likely reason is that TARGETDIR is not preserved between the install and the uninstall, therefore it has no value, and attempts to use it in an uninstall custom action will result in failure to find the file. The easiest solution (apart from always installing to known locations such as common files etc) is to save TARGETDIR to the registry and retrieve it later. In the VS IDE you can create a registry item with the value [TARGETDIR] to have it resolved at install time.