francoisferreira
New Member
- Joined
- Jul 21, 2005
- Messages
- 24
Hi, does anybody know how I can refer to a public constant in a different workbook's (which is already open) VBA from the workbook which I am currently working on's VBA?
Tom,
Also, what do you mean by "Create Book1.xls and place this code into the workbook class:"? Do you mean create a new class object in the VBAProject "Book1.xls" and paste the code within?
Thanks,
Jeff
Private Const FILE_OFFSET As Integer = 23
Private Const FILENAME_COL As Integer = 1
Public Property Get GetConstant(s As String) As Integer
Select Case UCase(s)
Case "FILE_OFFSET"
GetConstant = FILE_OFFSET
Case "FILENAME_COL"
GetConstant = FILENAME_COL
'etc
'
'
End Select
End Property