开发者

Error 1001 An error occured in sending the command to the application

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


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/


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.


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:

  • your Excel app is not running with elevated rights
  • advanced setting "Ignore other applications that use Dynamic Data Exchange (DDE)" is unchecked

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜