+ Reply to Thread
Results 1 to 12 of 12

I need to fix an excel macro that downloads box scores

  1. #1
    Registered User
    Join Date
    01-02-2012
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    9

    I need to fix an excel macro that downloads box scores

    I have a macro that calls up a separate workbook for each NBA team, checks if that team has played today and if it has it returns a box score for that team, parses it by individual player, states whether that team has won or lost (W or L), and puts a Y next to that date to notify the program to skip it next time.

    You are supposed to be able to just open the file called "Master" and it runs through each team's worksheet "Hawks Stat Collator Auto" for example. Right now when you open master, it opens the "Hawks Stat Collator Auto" but nothing happens and the program stops running. No connection is made to the website to download the scores.

    I am stuck right now and any help or insight would be appreciated. The master file and one of the team files are attached.

    Master.xlsm Hawks Stat Collator Auto.xlsm

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,583

    Re: I need to fix an excel macro that downloads box scores

    Do you get any error messages?

    When I run the code it definitely seems to be doing something - IE opens various times but eventually it stops here in the GetOpenIEByTitle function.
    Please Login or Register  to view this content.
    With this error - Automation error The object invoked has disconnected from its clients.

    Is this what's happening to you?

  3. #3
    Registered User
    Join Date
    01-02-2012
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: I need to fix an excel macro that downloads box scores

    right now no connection is being made, it is simply opening the hawks collator and then just stops. No spinning wheel or anything. I am going to try on my laptop to see if I can at least make a connection.

  4. #4
    Registered User
    Join Date
    01-02-2012
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: I need to fix an excel macro that downloads box scores

    I tried it on my laptop and it DID make a connection but just to the main url espn.com, it didn't go any further and then just ended.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,583

    Re: I need to fix an excel macro that downloads box scores

    Has this code worked in the past?

  6. #6
    Registered User
    Join Date
    01-02-2012
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: I need to fix an excel macro that downloads box scores

    yes since 2010. I don't know if it has stopped because of a change in their urls, or table structures or something else. When I copy and paste a box score into the collator and push collate it works correctly, so I know it has something to do with connecting to the website and finding the right page.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,583

    Re: I need to fix an excel macro that downloads box scores

    Well it's definitely possible that the site has changed structure.

    Where do I find the 'collator'?

  8. #8
    Registered User
    Join Date
    01-02-2012
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: I need to fix an excel macro that downloads box scores

    I attached two files in my first post. master.xlsm is the main file that i open. when that is opened it cycles through each team file "Hawks Stat Collator Auto.xlsm" for example. Then it checks that file to find if that team has played a game that day and if it has it should pull that specific box score. Then close that team file and open the next one.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,583

    Re: I need to fix an excel macro that downloads box scores

    So what is the 'collator' that works?

    Is it the workbook 'Hawks Stat Collator Auto.xlsm'?

    Have you tried stepping through the code to see what's happening?

  10. #10
    Registered User
    Join Date
    01-02-2012
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: I need to fix an excel macro that downloads box scores

    If you look at this file below and check the first tab called "box score" I have copied and pasted the box score there and if press collate it will work correctly. The problem lies in obtaining that box score and I believe the issue is a change in urls at espn.com. I had been using the date and team codes to get to the correct url.

    Hawks Stat Collator Auto.xlsm

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,583

    Re: I need to fix an excel macro that downloads box scores

    If the URLS etc have changed then I think the code might need a major overhaul.

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,583

    Re: I need to fix an excel macro that downloads box scores

    This is one of the URLs generated the code, in fact it's the first one.

    http://espn.go.com/nba/boxscore?gameId=321020001

    When I try that in IE it doesn't seem to be recognised and IE goes to the NBA index.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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