+ Reply to Thread
Results 1 to 3 of 3

Run-time error ‘-214074726 (800700aa)’ after 2 hours and 40 minutes of running

  1. #1
    Registered User
    Join Date
    11-17-2014
    Location
    Detroit, MI
    MS-Off Ver
    Office Professional 2013
    Posts
    2

    Run-time error ‘-214074726 (800700aa)’ after 2 hours and 40 minutes of running

    I am new to writing macros in Excel, but have created a macro that saves pictures to my hard drive from using a list of 40,000 internet explorer links. The code works fine for what appears to be 2 hours and 40 minutes and then stops returning the message.
    Run-time error ‘-214074726 (800700aa)’

    I can restart the program again right away, but it continues to stop after another 2 hours and 40 minutes. I know real programmers do not like using SendKeys, but this seems to work without an issue.

    Does anyone have an idea of why the code would stop and what I could simply modify to avoid the stoppage? Thanks.

    Wrcarr

    Below is the code.


    Sub View_and_Paste_Picture()

    Dim rowcount As Integer
    Dim urlToOpen As String
    Dim file_name As String
    Dim file_location As String

    rowcount = 1

    Set IE = CreateObject("InternetExplorer.Application")

    ' Show browser
    IE.Visible = True

    ' Go row by row in Excel until a blank cell is found
    Do While Sheets("Raw Data").Range("A" & rowcount) <> ""
    urlToOpen = Sheets("Raw Data").Range("A" & rowcount).Value
    file_name = Sheets("Raw Data").Range("M" & rowcount).Value
    file_location = Sheets("Raw Data").Range("L" & rowcount).Value

    ' Open the links in the same browser
    IE.Navigate2 urlToOpen

    ' Wait while IE loading...
    Do While IE.Busy
    Application.Wait DateAdd("s", 1, Now)

    ' Ctrl s keys to call up the save window
    SendKeys "^s"
    Application.Wait (Now + TimeValue("0:00:01")) 'Time delay in H:MM:SS

    ‘ Type the file name from column M of Excel sheet
    SendKeys file_name
    Application.Wait (Now + TimeValue("0:00:01")) 'Time delay in H:MM:SS

    ‘ Five tab keys to get to the file location
    SendKeys "{Tab}"
    SendKeys "{Tab}"
    SendKeys "{Tab}"
    SendKeys "{Tab}"

    ‘ Enter key to enable editing of the file location
    SendKeys "{Enter}"
    Application.Wait (Now + TimeValue("0:00:01")) 'Time delay in H:MM:SS

    ‘ Type file location from column L of Excel sheet
    SendKeys file_location
    Application.Wait (Now + TimeValue("0:00:01")) 'Time delay in H:MM:SS

    ‘ Type enter to confirm file location
    SendKeys "{Enter}"
    Application.Wait (Now + TimeValue("0:00:01")) 'Time delay in H:MM:SS

    ‘ Alt s to save file in desired location
    SendKeys "%s
    Application.Wait (Now + TimeValue("0:00:01")) 'Time delay in H:MM:SS
    ‘ Go to the next row in Excel
    rowcount = rowcount + 1
    Loop

    'Close Browser
    IE.Quit

    End Sub

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Run-time error ‘-214074726 (800700aa)’ after 2 hours and 40 minutes of running

    214074726 is the highest Integer in signed programming.

    Try dimensioning rowcount as Long instead.

    Source:
    http://en.wikipedia.org/wiki/C_data_types
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    11-17-2014
    Location
    Detroit, MI
    MS-Off Ver
    Office Professional 2013
    Posts
    2

    Re: Run-time error ‘-214074726 (800700aa)’ after 2 hours and 40 minutes of running

    Thanks I tried dimensioning rowcount as Long, but still ended up with the same error at approximately the same line.

    I am currently looking to see if my antivirus software may be kicking in for some reason.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Display running average of hours/minutes
    By Nu2Java in forum Excel General
    Replies: 10
    Last Post: 09-12-2014, 03:23 PM
  2. Replies: 13
    Last Post: 05-03-2013, 08:42 PM
  3. [SOLVED] Decimal Time to Hours and Minutes over 24 hours in total
    By FlyingTiger in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-17-2012, 06:18 AM
  4. Converting hours and minutes in military time to minutes
    By Argile79 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-13-2010, 02:42 PM
  5. [SOLVED] Convert hours and minutes in time format into fractions of hours..
    By Akern in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-21-2005, 10:06 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