+ Reply to Thread
Results 1 to 5 of 5

Changing the URL of a web data connection with VB

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Changing the URL of a web data connection with VB

    Hey guys,

    So I bit of VB novice so excuse the ignorance. I have looked around through the tips and the FAQ and I was unable to find what I was looking for so I am posting here for your help.

    I am working on a project where I am collecting data from a web site. I am using the web site data grab connection that Excel comes with. This is working fine, but I need to do this for many URLs. All of the URLs are the exact same except for the the very last part that goes "php?name=<name here>" so instead of setting each connection to a different URL. I want to create a cell where I can just put the name in that cell and then an activeX button to use the web data connection with the proper URL for that name. I use the macro recording to put the correct process behind the button, but I do not know how to VB change the URL it is using with respect to what is in my name cell.

    Here is what I have tried. F2 is the cell my "name" is in and the URL that X is equal to is the URL I am trying to edit with that cell. When I just use the macro to record it puts the URL "URL;<here>",_

    Please Login or Register  to view this content.
    Thanks for any help you can offer.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Changing the URL of a web data connection with VB

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-22-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Changing the URL of a web data connection with VB

    & Range("f2") ... I feel stupid now. Thank you very much.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Changing the URL of a web data connection with VB

    Don't feel that way. The point of the forum is extra eyes.

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Registered User
    Join Date
    11-22-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Changing the URL of a web data connection with VB

    Hmm... That actually doesn't seem to solve all of my problems. When I look at the "connections" I can see that every time I press the button it does create a connection, but it does not use the correct URL, so I guess the "& Range("f2") does not work. Any other suggestions?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1