如何通过双击使我的Office应用运行

How to make my office app run just by double click
2020-10-25
  •  译文(汉语)
  •  原文(英语)

我已经创建了一个办公室应用程序,如果我通过它运行VS2013task pane是越来越好装.

但是我想要的是通过双击运行我的xls文件.

我尝试通过在Web应用程序中IIS发布Web应用程序,然后使用中的已发布网站发布Office应用程序来IIS为其创建办公室AppManifest.

我不知道如何xls通过双击来使用这些文件来运行我的文件.

我的意思是,如果我从VS2013调试,这就是我的xls文件在"任务"窗格右侧的外观. 如何通过双击使我的Office应用运行

TestXl属于我的解决方案

如何通过双击使我的Office应用运行

如果我双击TestXl这就是我的xl文件的外观以及错误

如何通过双击使我的Office应用运行

我想要的是,当我双击时,我应该在图1中看到相同的xl文件. TestXl

速聊1:
您是说要打开.xls文件时将编写的应用作为默认应用吗?还是说您已经创建了一个.xls文件,并希望在双击该文件时在Office中打开它?
速聊2:
.xls文件是Excel工作簿,它们不会运行.它们将加载到Excel中,而Excel将依次运行工作簿中的所有代码.如果系统上安装了Excel,则双击.xls文件应自动启动Excel并加载该工作簿.如果没有Excel,它将不会执行任何操作(尽管Windows会提示您选择一个用于打开它的应用程序).我不知道IIS或Web发布与什么有关.
速聊3:
请参阅我编辑的问题
速聊4:
请参阅我编辑的问题
速聊5:
我们不知道您在"任务"窗格中的代码在做什么,但是很显然,它正在尝试访问网络或Internet连接上无法从Web服务器获得的内容(错误文本中已明确说明).
解决过程1

这有点长,但是....尝试先打开Excel而不是使用"开始"进行调试,然后从Visual Studio解决方案中单击"调试"菜单->"附加到进程",然后从中选择EXCEL.EXE.可用进程列表.

然后打开您的xls文件.

希望它能解决您的问题.

速聊1:
我想做的就是将我的TestXl文件提供给没有VS的最终用户.
速聊2:
我了解这一点,但是您想调试xls文件.我给你这个选择.
速聊3:
我不想调试xls.我已经完成了开发.现在,我要执行的操作是将此xls文件以及所有需要运行的支持文件提供给某个人.
速聊4:
这是不明白的.无论如何,请在发布版本中编译项目,然后尝试双击xls文件,而不是从VS中的运行按钮而是从发布文件夹中加载项目.

I have created an office app and if i run it through VS2013 the task pane is getting loaded well.

But what i want is to run my xls file just by double clicking on it.

I tried by publishing the web app in IIS and publish the office app by using the published website in the IIS which generated the office AppManifest for me.

I don't know how to use those to run my xls file just by double clicking it.

What i mean is if i debug from VS2013 this is how my xls file look like with the Task pane right side. How to make my office app run just by double click

This TestXl belongs to my solution

How to make my office app run just by double click

If i double click the TestXl this is how my xl file look like with the error

How to make my office app run just by double click

what i want is i should see the same xl file in fig 1 when i double click the TestXl

Talk1:
Are you saying that you want the app you've written to be the default when opening .xls files? Or are you saying that you've created a .xls file and want it to open in Office when you double-click it?
Talk2:
.xls files are Excel workbooks, and they don't run. They load in Excel, which in turn runs any code in the workbook. Double-clicking an .xls file should automatically start Excel and load that workbook if Excel is installed on the system. It won't do anything if Excel is not (although Windows will prompt you to choose an app with which to open it). I don't know what IIS or web publishing has to do with anything.
Talk3:
please see my edited question
Talk4:
please see my edited question
Talk5:
We don't know what your code for that Task pane is doing, but it's clearly trying to access something on a network or internet connection that isn't available from your web server (which is clearly stated in the error text).
Solutions1

This a bit of a long shot but.... Try opening Excel first instead of using 'Start' to debug, then from your Visual Studio solution click on the Debug menu -> 'Attach to Process' and select EXCEL.EXE from the list of available processes.

then open your xls file.

I hope it will address you issue.

Talk1:
What i want to do is to give my TestXl file to the end user, who doesn't have VS.
Talk2:
I understand that, but you wanted to debug you xls file. I give you that option.
Talk3:
I don't want to debug the xls. I am done with development. Now what i want to do is to give this xls file and any supporting files needed to run to some one.
Talk4:
this wasn't understand from question. Anyhow, Compile your project in release and try to load it not from the run button in VS but from the release folder by double clicking the xls file.
转载于:https://stackoverflow.com/questions/30400512/how-to-make-my-office-app-run-just-by-double-click

本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文

留言回复
我们只提供高质量资源,素材,源码,坚持 下了就能用 原则,让客户花了钱觉得值
上班时间 : 周一至周五9:00-17:30 期待您的加入