Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8496603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:53:59+00:00 2026-06-10T23:53:59+00:00

I have a text file on my website that contains only the string 1.15

  • 0

I have a text file on my website that contains only the string “1.15” (for the version of the application I am writing). Upon initialization of the user form, I would like to read that file from its URL and have the string “1.15” returned so that I can check it against the application’s version (stored as a const string).

Here is the format I’d like to have…

Const version As String = "1.14"
Const currentVersionURL As String = "http://mywebsite.com/currentversion.txt"

Sub UserForm_Initialize()

    If version <> GetCurrentVersionNumber() Then
        MsgBox "Please update the application."
    End If

End Sub

Function GetCurrentVersionNumber() As String

    ' What do I put here? :(

End Function

I am aware of the Workbooks.OpenText method, but I don’t want to write the string into a workbook. I have tried using the ADODB.LoadFromFile and WinHttp.WinHttpRequest.Open methods, but both are unable to read the file.

Any suggestions for what to fill GetCurrentVersionNumber() with would be greatly appreciated. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:54:00+00:00Added an answer on June 10, 2026 at 11:54 pm

    While it doesn’t directly answer your question, a simpler approach would be to make it an XML file instead of a text file. There are more built-in tools to easily open an XML file from a URL. The secondary advantage is that it also makes it more flexible, so you can more easily add new data elements to the XML file later on.

    For instance, if you made a http://mywebsite.com/currentversion.xml file that looked like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <AppData>
        <Version>1.14</Version>
    </AppData>
    

    Then, in VB.NET you could easily read it like this:

    Function GetCurrentVersionNumber() As String
        Dim doc As New XmlDocument()
        doc.Load("http://mywebsite.com/currentversion.xml")
        Return doc.SelectSingleNode("/AppData/Version").InnerText
    End Function
    

    Or, in VBA, you could read it like this:

    Function GetCurrentVersionNumber() As String
        Dim doc As MSXML2.DOMDocument??  ' Where ?? is the version number, such as 30 or 60
        Set doc = New MSXML2.DOMDocument??
        doc.async = False
        doc.Load("http://mywebsite.com/currentversion.xml")
        GetCurrentVersionNumber = doc.SelectSingleNode("/AppData/Version").Text
    End Function
    

    You will need to add a reference to the Microsoft XML, v?.? library, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Text file that contains data separated with a comma , . How
I have a file upload web-form on the website and it needs to only
I have a jquery-ui-dialog that contains a <form> which contains a <input type=file >
I have a listview populated by a text file hosted on my website that
I have text file with some stuff that i would like to put into
I have a text file that I want to edit by rewriting it to
I have a website that is written in asp.net where the text is resourced
We have a simple website that contains (take your pick, for this example) blog
I have an asp.net website that allows the user to download largish files -
The setup: I have a standard .php file (index.php) that contains two includes, one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.