using System.Runtime.InteropServices;
using Microsoft.Win32;
using System;
using System.Windows.Forms;
using Microsoft.Office.Interop.Excel;
namespace UDFTest
{
[Guid("05DE8F39-D755-4912-B40F-EDD5EC37CEBA")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class UDF
{
public string GetAppName()
{
return Globals.ThisAddIn.Application.ActiveSheet.Name; //Globals.ThisAddIn为null
}