Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

[noobish] Use an external datasource to check values in a program using VB?

Options
  • 15-03-2012 1:17pm
    #1
    Registered Users Posts: 14,163 ✭✭✭✭


    I have a macro in a program we use here at work that is checking for codes on the screen. This all works fine but as its on a number of systems in here if a new code is added at the minute it means manually editing the code on everyones computers.

    I was wondering as we have a sharedrive could a word document or notepad (or anything that sups can edit) that can be updated by anyone with new codes. Can this be used as a datasource where my code would look at it to see if the data on screen matches data in the document?

    sample of the code is below

    Sub Reminder()
    Dim dc1 As String 'code
    dc1 = Application.GetText(9, 11, 9, 19) 'xy coords of screen
    If (dc1 = "123456789" Or dc1 = "987654321") then
    Msg = "MESSAGE WILL GO HERE"
    Style = vbOKOnly + 48
    Title = "Interest Reminder!"
    Response = MsgBox(Msg, Style, Title)

    End If
    End Sub

    So you can see dc1 is looking for the number in the code itself so with number of computers each one would have to be manually updated on each one each time there was a new code, so you can see that a single external source would make the process a lot easier?


Advertisement