В C переменные с пометкой extern
должны быть объявлены локально, но могут быть определены извне. Возможно ли это с VBA? Таким образом, я начинаю примерно так:Как объявить переменную `extern` в VBA?
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