|
本帖最后由 ralphyu 于 2016-5-12 12:43 编辑
哪位大神可以指点一下,如何用vsto2015写excel函数的插件?是否需要额外处理,才能在excel自动化中使用?
网上关于vsto函数插件的资料太少了,之前尝试excel启动跳窗是没有问题的,但函数无法作用。
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Xml.Linq;
- using Excel = Microsoft.Office.Interop.Excel;
- using Office = Microsoft.Office.Core;
- using Microsoft.Office.Tools.Excel;
- namespace ExcelAddIn1
- {
- public partial class ThisAddIn
- {
- public double ptca(double a,double b)
- {
- return (a - b) / a;
- }
- private void ThisAddIn_Startup(object sender, System.EventArgs e)
- { }
-
- private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
- {
- }
- #region VSTO generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InternalStartup()
- {
- this.Startup += new System.EventHandler(ThisAddIn_Startup);
- this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
- }
-
- #endregion
- }
- }
复制代码 |
|