0

I am working on a project that requires a certain amount of interactivity between the excel user and a web server.

I know you can use the

    hyperlink.follow 

method to open a url within the default browser.

However what I would like to accomplish is to be able to open a url behind the scenes without the page opening in a browser.

Does anyone know how this can be accomplished.

the following constraints apply.

  1. We cannot assume the user has a particular browser installed, ie. chrome, for example, nor can we assume the user has a browser installed at all.
  2. We cannot assume the users all have the same os. Some may have win7, some may have win10. We just don't know.
  3. We can assume that the computer is connected to the internet and has an IP address, and that firewalls will not be an issue.
2
  • 1
    Possible duplicate of Sending http requests with VBA from Word Commented Mar 25, 2016 at 14:12
  • What interactivity is required? The answer will be more specific, if you provide details. Commented Mar 26, 2016 at 7:27

1 Answer 1

1

You can open (read the entire content) of the web page specified by its Url like shown in the following Excel VBA code snippet:

Option Explicit

'sample procedure to read entire url content
Sub ReadUrlDoc()
  'sample url address
  Const url As String = "http://www.examn8.com"
  Dim urlText As String

  With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", url, False
    .Send
    'url content
    urlText = .ResponseText
  End With
End Sub

The solution does not open/depend on the web browser. Hope this may help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.