0
在C中,標記爲extern
的變量只需要在本地聲明,但可以在外部定義。這可能與VBA?因此,我喜歡這樣的事情:如何在VBA中聲明一個`extern`變量?
DataSource_14.accdb:
' References CommonFunctions.accdb
Public SOURCE_ID As Long = 14
Public Sub Baz()
Foo
Bar
End Sub
CommonFunctions.accdb:
Extern SOURCE_ID As Long ' <- what's the proper way to declare this?
Public Sub Foo()
Debug.Print "Doing Foo stuff with source " & SOURCE_ID
End Sub
Public Sub Bar()
Debug.Print "Doing Bar stuff with source " & SOURCE_ID
End Sub