+ Reply to Thread
Results 1 to 18 of 18

Sudden/unexplained Run-Time 7 error

  1. #1
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Question Sudden/unexplained Run-Time 7 error

    ok, so this one has me baffled, i've got a workbook with a lot of code in it, it's been working fine for a long time (with one minor unrelated issue) and was working fine on thursday, and yesterday it started throwing the following error when running one procedure....

    Run-time error '7':

    Out of Memory
    I've checked the code, nothing had changed, and all seems ok, the calling procedure i will also list below, but also seems fine.

    There literally has been no changes between thursday and now that should have affected this, a couple of drivers for phone connection, multibit bitcoin program install, flash player update and that's about it, but, to be sure i've rolled the OS back to the 7th, and it is still failing.
    I've checked the Internet Explorer settings, and as far as i know, nothing changed in there either that would affect it connecting out

    OS: Windows 7 64 bit
    Office 2010 64 Bit
    System RAM 32GB


    here's the procedure that's failing......
    Please Login or Register  to view this content.
    I've marked the line it errors at, with red text

    and here's one of the procedures that calls it

    Please Login or Register  to view this content.
    by placing msg boxes at various points, i can see the correct data is being passed to the routine, and i know i have the 'On Error Resume Next' line commented out, that was so i could find out why the comments were not showing.

    this is an example of the completed line that gets the images, and also the line it's failing on
    Please Login or Register  to view this content.
    anyone got any ideas ? because i don't understand this one

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    Try hard coding this line
    Please Login or Register  to view this content.
    as
    Please Login or Register  to view this content.
    and call Private Sub Chart_Scale_Change from the usual procedure

    Does it still fail?

    I tested the hardcoded line and it works.
    So if the code does not fail with the hardcode - then we know where the problem lies
    - write the string value to a cell with
    Please Login or Register  to view this content.
    and spot the error

    If the code fails with the hardcode
    , then try this VBA standalone
    Please Login or Register  to view this content.
    Last edited by kev_; 04-18-2017 at 04:57 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    hard coding it failed, already tried that, and also changing it to https as that seems to be what it redirects too.

    havent tried the private sub, will try that and post back. EDIT: I read that bit wrong, yes i hard coded the address in, then changed the item in the cell using it's drop down list, that's what triggers the change and then the update comments chart code.

    when this is failing with the "Resume Next" code in play, you see a comment indicator appear and then vanish from each cell in the range, stepping down through the column, sometimes it gets to the end, sometimes it doesn't, and then at the stopping point, if you have the vba editor open, it brings that to the top most view status, if you dont have it open, it opens it briefly then closes, just long enough for you to see the icon open in the task tray then close, this too is new

    i'm going to try and run the file on another machine later and see if it's my office install that is knackered

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    i'm going to try and run the file on another machine later and see if it's my office install that is knackered
    Good way to eliminate one likely cause
    I would also clear all your internet temporary garbage
    Please report back with your findings
    thanks

  5. #5
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    hmmm, never thought about the temporary internet garbage, i'll try that too, going to start out wide and narrow down on this, because of the wide restrictions and other trigger code in this workbook, i'll go for this...

    1. try your stand alone test sub in a new workbook
    2. clear internet crap
    3. will try to message box the link it's auto compiling, i did use message boxes previously to check data being passed, and the error code generated, but i didn't try and put the link as text in a message box, that might be worth a try
    4. try different machine
    5. i'll send you the entire work book, but i'll need to remove sensitive data from it first.


    be back in a bit

  6. #6
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    Failed at first item on my list....... straight "Out of Memory" no mention of Run-Time Error 7 and no debug button option !

    Comment is inserted into cell A1 but is blank


    I'm beginning to wonder if this is machine/office install related, need to go and try and clear temp crap off the machine now, and repeat test


    Edit:
    If run from the debugger, i get the run-time error message as before, but again no highlight on the failed line, although it's pretty obvious
    Last edited by the_gunslinger; 04-18-2017 at 05:36 AM.

  7. #7
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    Ran CCleaner, cleaned out a fair bit of garbage, re-ran the stand alone routine in a new workbook, same error

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    I am pretty certain the problem is on your machine - the failure in running that simple bit of VBA demonstrates it.
    And it's one of those annoying problems that you will probably never get a fix on.

    Is it Excel?
    - may be the file? did you run the simple VBA from a clean file? EDIT - yes you did
    - if it's not the file, then a re-install of Excel may fix it

    Otherwise ..... ...... a bigger job....

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    Did you re-boot after clean up?

  10. #10
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    no, that was what i was about to do, also, because this file is on version 34, i have numerous older ones not used for a while, that whilst have issues or old code, do have this comment code in, and they were failing too.


    off to reboot now and grab a coffee

  11. #11
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    Create a hyperlink in an Excel cell to "https://chart.finance.yahoo.com/z?s=RMG.L&t=3m&a=v&lang=en-GB&region=GB.png"
    Does that work?

  12. #12
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    Try putting the link in a textbox instead:
    Create a text box and ensure name consistent with code.
    Please Login or Register  to view this content.
    Did that work?

  13. #13
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    hyperlink on it's own works

    excel file on different machine (32bit version) works fine.... i doubt it's a 32 vs 64bit version issue as the file was written in the 64bit version

    just rebooted, going to try the stand alone code first, then my file

  14. #14
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    standalone vba code failed
    so did my file
    so did textbox method


    all return out of memory error


  15. #15
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    Being consistent is good

    This is what we know:
    - (my) simple code is good and it works with 2010 and 2016 (I tested both)
    - your code did work on your PC and now it does not
    - simple code also fails on your PC
    - your PC also refuses to use the same process to put image into a text box
    - a hyperlink to the same image works
    - you have tried creating a clean file and that made no difference

    The problem is your PC - possibly a file corruption

    Is it Excel or something else?
    - next step (if you cannot live with this issue) is to re-install Excel and hopefully that will fix it

  16. #16
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    that looks like my only option, complete re-install of office, but i am at a loss as to why system restore failed to fix the issue

    thank you btw, for your help with this

  17. #17
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Sudden/unexplained Run-Time 7 error

    You are welcome
    I hope that fixes things

  18. #18
    Registered User
    Join Date
    05-19-2016
    Location
    uk
    MS-Off Ver
    2010
    Posts
    18

    Re: Sudden/unexplained Run-Time 7 error

    I hope so too, looks like i'm going to be a busy bunny the next few days, re-installing and updating office,
    and then spending a huge chunk of time re-installing add-ins and reseting all the settings i've spent ages adjusting


    I am beginning to suspect that the culprit to my problems, may indeed be this file, in particular the one issue it has with windows hooks, and one that doesn't release right which is why i'm reluctant to post the whole file for people to look at
    Think i might have to isolate the code that's involved and post it up to see where i've gone wrong, i'd always assumed i'd got something wrong in the 64bit side of the code, and that it would work in 32bit,
    but on my test of this comments issue earlier on my other machine (32bit), i tested the other thing and it crashed the same, so looks like i have something else wrong, but it's above my abilities to fix now

+ 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] Unexplained VBA error (1004)
    By daumebtb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-04-2016, 11:41 AM
  2. [SOLVED] Unexplained Slowness
    By shawnvw in forum Excel General
    Replies: 6
    Last Post: 10-09-2015, 08:24 PM
  3. [SOLVED] Sudden 'method range of object _worksheet failed' Error
    By henryBukowski in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-28-2014, 08:43 AM
  4. [SOLVED] Sudden appearance of Run-time error '13': Type mismatch in previously working code
    By Rhudi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-22-2014, 11:30 PM
  5. [SOLVED] Sudden "Type mismatch error"
    By EdwardStephenson in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-29-2014, 10:49 AM
  6. Sudden 'Compile Error' message in browse sheets macro.
    By henryBukowski in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-23-2013, 06:19 AM
  7. [SOLVED] Unexplained "Bad Record Length" error / bug?
    By Dave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2006, 11:30 AM

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