Hi,

I found the code below which I believe will allow me to make sure the users are using the most up to date version of an Excel database. In the example from the post on the Ozgrid forum post here, the post mention that the version number should be placed in a .vi file, but can I just use a .txt file to store the version number? I asked for help from that post but was told I had to start a new post. So sorry for double posting this question. I continue to get a compile error. at "Call CKV" Sub or Function not defined.

I placed the code below in a module in the excel workbook.


Private Sub CKV(var1)
     'FUNCTION TO DETERMINE IS USER HAS LATEST VERSION OF FRONT END

    On Error Resume Next 'JUST IN CASE NO NETWORK DRIVE

    Dim bypass As Label
    Dim ToolPath2 As String
    Dim tversion As String
    Dim newversion As String
    Dim CKV2 As Integer

    Select Case var1
    Case Is = ""
        CKV2 = 0
        GoTo bypass
    Case Is <> ""
         'DO NOTHING
    End Select

     'SET BASIC PATH
    ToolPath2 = "C:\Users\Desktop\TestDBA\" 'BASE PATH GOES HERE
    tversion = "Version.txt" 'TEXT FILE WITH VI EXTENSION TO HOLD MOST CURRENT VERSION NUMBER ON FIRST LINE

     'OPEN FILE AND CHECK VERSION
    filenumber2 = FreeFile
    On Error Resume Next
    Open ToolPath2 & tversion For Input As #filenumber2

     'READ FILE LINE 1
    Line Input #filenumber2, newversion
    On Error GoTo 0
    Close #filenumber

     'COMPARE
    Select Case newversion
    Case Is = var1
        CKV2 = 0
    Case Is <> var1
        CKV2 = 1
    End Select

     'MESSAGE USER
    Select Case CKV2
    Case Is = 1
         'USER MESSAGE
        With DataEntry
            .tb_status.Value = newversion & " Available-Update your Macro"
            .tb_status.BackColor = &HC0FFFF

        End With

    Case Is = 0
        With DataEntry
            .tb_status.Value = currentv & " Version is current."
        End With
    End Select

bypass:

End Sub
I then put the code below in the the Sub userForm_Initialized of the userform. I continue to get a compile error. at "Call CKV" Sub or Function not defined. I can't seem to figure this out.

Private Sub UserForm_Initialize() 
     'INITIALIZE FORM
     'VERSION CODE
    currentv = "5.00" 
    Call CKV(currentv) 
End Sub
Can anyone help get this working on my excel worksheet.