Results 1 to 4 of 4

Strange 'object invoked disconnected' then '1004 - object defined' errors

Threaded View

sumdumgai Strange 'object invoked... 10-12-2015, 09:30 AM
sumdumgai Re: Strange 'object invoked... 10-12-2015, 08:17 PM
skywriter Re: Strange 'object invoked... 10-12-2015, 09:25 PM
sumdumgai Re: Strange 'object invoked... 10-14-2015, 09:48 PM
  1. #1
    Forum Contributor
    Join Date
    07-16-2007
    MS-Off Ver
    Excel 2003 and Excel 2016
    Posts
    178

    Strange 'object invoked disconnected' then '1004 - object defined' errors

    I have some VBA code that pulls stock quotations from Yahoo into Excel. The code has been running on Excel 2003 for years. Recently, I copied the application to a new desktop running W10, Office 2003, 2007 and 2013. It runs fine there under 2003. I also copied the application to a laptop running W10, Office 2003 and 2007. Most of the functions work on the laptop fine except the query that pulls data from Yahoo. The first time I run it, I get the '-2147417848 (80010108) automation error (object invoked disconnected' error. If I reset the macro and run again, I get the '1004 - Application - defined or object-defined error'. Thereafter, I can't even save or close the workbook. Excel hangs and has to be killed.

    Here's some code:
        sDate = "100115"
        eDate = "100915"
        
        smo = Int(Left(sDate, 2))
        sda = Int(Right(Left(sDate, 4), 2))
        syr = Int(Right(sDate, 2))
        
        emo = Int(Left(eDate, 2))
        eda = Int(Right(Left(eDate, 4), 2))
        eyr = Int(Right(eDate, 2))
    
            With Sheets("Web Data")
                .Range("A:Z").Delete
    
                theGetDataUrl = _
                "http://ichart.finance.yahoo.com/table.csv?" & "a=" & smo - 1 & "&b=" & sda & "&c=" & syr _
                & "&d=" & emo - 1 & "&e=" & eda & "&f=" & eyr & "&g=d&s=" & "RAD"
     
                Do
                    Set YahooQuery = .QueryTables _
                    .Add(Connection:= _
                    "URL;" & theGetDataUrl, Destination:=.Cells(1, 1))
                    With YahooQuery
                        '.WebSelectionType = xlAll
                        .WebSelectionType = xlAllTables
                        '.WebSelectionType = xlEntirePage
                        .WebFormatting = xlWebFormattingNone
                        .WebPreFormattedTextToColumns = True
                        .WebConsecutiveDelimitersAsOne = True
                        '.WebSingleBlockTextImport = True
                        .WebSingleBlockTextImport = False
                        '.WebDisableDateRecognition = True
                        .WebDisableDateRecognition = False
                        .RefreshStyle = xlOverwriteCells
                        .FieldNames = True
                        '.RowNumbers = False
                        .FillAdjacentFormulas = False
                        .PreserveFormatting = True
                        '.RefreshOnFileOpen = False
                        .SavePassword = False
                        '.SaveData = True
                        '.RefreshPeriod = 0
                        .AdjustColumnWidth = True
                        .WebDisableRedirections = False
                        '.BackgroundQuery = True
                        .Refresh BackgroundQuery:=False
                    End With
     
                Loop Until .Cells(1, 1) <> ""
            End With
    The error occurs on the 'Refresh' command.

    Thanks for any help or suggestions.
    Last edited by sumdumgai; 10-13-2015 at 07:11 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error 440 - object invoked has disconnected from its clients
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2013, 11:34 AM
  2. Error:The object invoked has disconnected from client.
    By gpnavin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2012, 01:09 PM
  3. Object Invoked has Disconnected from it's Clients
    By toddbuckles in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-10-2010, 04:28 PM
  4. The Object Invoked Has Disconnected
    By pharring in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2010, 09:54 AM
  5. the object invoked has disconnected from its clients
    By excellar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2008, 03:02 PM
  6. the object invoked has disconnected from its clients
    By excellar in forum Excel General
    Replies: 1
    Last Post: 08-22-2008, 07:48 AM
  7. Object invoked disconnected from its clients.
    By Spreadsheet Solutions in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2006, 06:10 AM

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