+ Reply to Thread
Results 1 to 5 of 5

[SOLVED] Application.Calculate or F9 causing runtime / Visual Basic error

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Manchester, GB
    MS-Off Ver
    365,2016,2013,2010,2007,2003
    Posts
    17

    [SOLVED] Application.Calculate or F9 causing runtime / Visual Basic error

    I've not found a definitive solution to this issue (which seems to appear infrequently and probably for different reasons) but here's my own particular version of this problem and my solution.

    NB: to be clear, I've not actually found the solution, but I have solved the issue

    'Application.Calculate' (either inline or Immediate) was causing a VBA runtime error in just this one workbook. 'Calculate' was the same result. F9 to recalculate also came up with an error. Debug found no errors, so I feared I'd corrupted an external library somehow.

    I use an external module that I developed myself by Googlesifting (code pasted below) that references Microsoft Outlook 14.0 Object Library.

    When I tried to F9 recalculate in Excel, it popped up with the error and then popped up the References dialog. I noticed the Outlook library was highlighted, and disabling that library fixed the issue. I've updated to the latest version of the external module and this works OK. Still not much idea what happened but it's fixed now. The main change from v3.06 to v3.07 was to remove a couple of unnecessary routines, so it seems v3.06 had a line of dodgy code that somehow caused this issue. I've not tried to isolate which line because I can't be bothered! Maybe if someone has the time to analyse the code....
    Last edited by baldmosher; 05-20-2013 at 05:23 AM.

  2. #2
    Registered User
    Join Date
    09-27-2012
    Location
    Manchester, GB
    MS-Off Ver
    365,2016,2013,2010,2007,2003
    Posts
    17

    Re: [SOLVED] Application.Calculate or F9 causing runtime / Visual Basic error

    FUBAR version of modAppsOffice v3.06:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Manchester, GB
    MS-Off Ver
    365,2016,2013,2010,2007,2003
    Posts
    17

    Re: [SOLVED] Application.Calculate or F9 causing runtime / Visual Basic error

    Fixed version of modAppsOffice v3.07:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-27-2012
    Location
    Manchester, GB
    MS-Off Ver
    365,2016,2013,2010,2007,2003
    Posts
    17

    Re: [SOLVED] Application.Calculate or F9 causing runtime / Visual Basic error

    And just for the record, here's the latest v3.08, as I did a little bit of tweaking this morning after testing my Outlook macro in Office 2010. It's essentially the same code as v3.07.

    Please Login or Register  to view this content.
    Last edited by baldmosher; 05-20-2013 at 05:26 AM.

  5. #5
    Registered User
    Join Date
    09-27-2012
    Location
    Manchester, GB
    MS-Off Ver
    365,2016,2013,2010,2007,2003
    Posts
    17

    Re: [SOLVED] Application.Calculate or F9 causing runtime / Visual Basic error

    Just a quick additional note, re the module, you're free to use this code as you wish, and suggestions for improvements are welcomed. I don't have a github for it, sorry.

+ 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