+ Reply to Thread
Results 1 to 10 of 10

Very LONG URL IN VBA not working properly.

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Very LONG URL IN VBA not working properly.

    My question involves getting a web query to pull into excel with a VERY LONG url (user_id numbers). I tried doing a search on the topic but could not get anything specific to my issue. Here is my code:

    Please Login or Register  to view this content.
    Last edited by zbor; 10-26-2012 at 01:41 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,107

    Re: Very LOONNGG URL IN VBA not working properly.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Very LONG URL IN VBA not working properly.

    Here is my code with the code tags inserted to comply with posting guildelines:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Very LONG URL IN VBA not working properly.

    What's the question?

  5. #5
    Registered User
    Join Date
    10-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Very LONG URL IN VBA not working properly.

    I can't get this URL to work properly for the webquery pull. When i had fewer numbers initially it worked fine but when the url expanded i started having issues with the code bombing out when it hits the code line (.Refresh BackgroundQuery:=False
    ). The problem has to be the multitude of numbers present. My suspicion is that maybe the numbers are being interpreted as Strings instead of values?

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Very LONG URL IN VBA not working properly.

    No, they should be strings, you're sending a web request. I suspect that you're trying to pull more results than the web server will accept. You might just have to break your request down.

    Try copy and pasting your long string into the browser to see the results of your query; this might give you some hints

  7. #7
    Registered User
    Join Date
    10-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Very LONG URL IN VBA not working properly.

    Good point. The actual URL is really this long and works fine in the browser. However, trying to pull in VBA is a different story.

  8. #8
    Registered User
    Join Date
    10-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Very LONG URL IN VBA not working properly.

    I copied the URL in case someone wants to take a stab and getting this to work in VBA.

    "https://www.abcd.com/reports/analysis/?bookmark=1234&search_action=ans&search_min_duration=30&search_summary=0&search_timezone=US/Eastern&search_startdate=&10/15/2012&search_roistart=marketstart&search_zerocounts=0&search_max_duration=600&search_roiend=marketend&search_type=calls&search_user_id=" _
    68465,68464,73114,66424,73484,25913,28632,37084,37207,66310,66311,68909,37273,69328,68477
    ,68903,66378,66321,73033,107557,73091,107559,107556,107558,66382,107423,107420,107421,107422
    ,102978,107567,107564,107565,107566,73504,73505,66392,66456,73541,73540,102977,102976,108262
    ,108261,19589,66234,66395,66394,69315,73507,66386,68407,68889,68890,104854,106878,106875,106876
    ,106877,48896,106772,106769,106770,106771,29806,106650,106647,106648,106649,66274,106830,106827
    ,106828,106829,27139,106609,106606,106607,106608,27126,106601,106598,106599,106600,68895,106349
    ,106346,106347,106348,66422,106271,106268,106269,106270,66421,106301,106298,106299,106300,104853
    ,104852,66397,68896,107316,69321,107298,107295,107296,107297,75030,107319,107318,107317,107205
    ,107208,107206,23519,107207,24956,107266,107263,107264,107265,66253,107278,107275,107276,107277
    ,66279,107735,107732,107733,107734,66280,107739,107736,107737,107738,68898,107755,107752,107753
    ,107754,66309,107041,107038,107039,107040,107056,68893,107053,107050,107051,107052,69317,107058
    ,107057,107055,68904,108040,108037,108038,108039,68846,108036,108033,108034,108035,66389,108028
    ,108025,108026,108027,49925,108003,108000,108001,108002
    &search_defaults=0&search_by=campaign&search_subtotals=0&search_enddate=10/24/2012

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Very LONG URL IN VBA not working properly.

    We can't even try it since the site requires log in. I suspect that the length of the string (if it works in the browser) is greater than the length than the webquery object can support. So you'll need to get another way of importing the data

  10. #10
    Registered User
    Join Date
    10-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Very LONG URL IN VBA not working properly.

    I figured it out and got it to work. I simply chunked out the ids into three webqueries instead of one gigantic query which worked like a charm. Thanks for the input everyone!

+ 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