1、可以用全局变量
http://www.foxtable.com/help/topics/0325.htm
2、或者动态编译
Functions.remove("函数")Dim Code As StringCode = "return 1+2+3"Functions.Add("函数",Code)Functions.Complie()Dim result = Functions.Execute("函数")msgbox(result)