I am trying to write my own version control code to manage ensuring I have the latest module in each instance of databases...
To that end I would like a generic way to call the version out of each module. I was thinking something like the below using application.run but it does not like that syntax.
Intuitively it seems like the scope somehow can't see the correct module but the modules are all in the Application object... Secondly I am not sure the parameter will pass and return but a stack overflow post suggests it would.
Code in each module would look similar to the below
To that end I would like a generic way to call the version out of each module. I was thinking something like the below using application.run but it does not like that syntax.
Intuitively it seems like the scope somehow can't see the correct module but the modules are all in the Application object... Secondly I am not sure the parameter will pass and return but a stack overflow post suggests it would.
Code:
Sub ModuleVerTest()
Dim lngVersion As Long
Application.Run "mdlBrand.Version", lngVersion 'cannot find mdlBrand.Version Error 2517
'mdlBrand.Version lngVersion 'works if commented in and above commented out
Debug.Print lngVersion
End Sub
Code in each module would look similar to the below
Code:
Const conmdlBrandversion As Long = 2
Public Sub Version(Optional ByRef lngReturn As Long = 0)
lngReturn = conmdlBrandversion
End Sub