0
就像一个例子,说我想在多个领域引用msgbox,我可以为此创建一个函数吗?私人还是公共?区别在哪里?反复参考代码的最佳方式是什么?
下面是一个例子。
Public Function Message() As String
MsgBox("Test Message")
End Function
另外,为什么我会得到以下信息:Function 'Message' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used
它好像它只是一个警告,它似乎在工作的时候调用的函数。
使它成为公共子消息()并且错误将消失... – klabranche 2012-04-10 19:51:57