I have a VB application, that uses some global variables to store data that is required by multiple forms and modules, this works fine. However if a user opens up another wo
I think you could get the workbook name in runtime.
So, a Collection probably will do the job.
'//-- module --
Public var As Collection
Public Function SetVar(Value)
If var Is Nothing Then
Set var = New Collection
End If
var.Add Value, ThisWorkbook.Name
End Function
Public Function GetVar() As Variant
If var Is Nothing Then
GetVar = Null
Else
GetVar = var.Item(ThisWorkbook.Name)
End If
End Function
Not sure if it'll work for your Addin though.