Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6607421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:30:05+00:00 2026-05-25T19:30:05+00:00

Here’s the current code I have got private void recalculateRRange(Excel.Range UsedRange) { Excel.Range currentRRange

  • 0

Here’s the current code I have got

private void recalculateRRange(Excel.Range UsedRange)
{
    Excel.Range currentRRange = null, firstRRange = null;
    currentRRange = (Excel.Range)UsedRange.Find("#HERE#", Type.Missing, Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart, Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, false, Type.Missing, Type.Missing);
    while (currentRRange != null)
    {
        if (firstRRange == null)
        {
            firstRRange = currentRRange;
        }
        else if (currentRRange.get_Address(Type.Missing, Type.Missing, Excel.XlReferenceStyle.xlA1, Type.Missing, Type.Missing) == firstRRange.get_Address(Type.Missing, Type.Missing, Excel.XlReferenceStyle.xlA1, Type.Missing, Type.Missing))
        {
            break;
        }
        //force current range to recalculate
        currentRRange.Calculate();

        currentRRange = (Excel.Range)UsedRange.FindNext(currentRRange);

    }
}

The above method is used to find the cells that marked as #HERE# and to force this cell to recalculate so we can get the updated results.

I managed to get this code working a day ago but somehow it’s not working now. I guess that code is somewhat buggy anyway as I have been able to capture the exception just one time. I wonder if there’s any better way to implement it?

Exception captured:

Exception from HRESULT: 0x800AC472
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Microsoft.Office.Interop.Excel.Range.Calculate()

I don’t know whether or not it meant something. My best guess is that probably something prevents currentRRange from calling Calculate().

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:30:06+00:00Added an answer on May 25, 2026 at 7:30 pm

    The error you get means VBA_E_IGNORE which in turn means that something/someone is running/interacting on that sheet… this could be a user and/or some complex calculation.

    You should set Visible = false on the Excel application object and wait a little while after selecting the Range and retry the Calculate call when you receive this error…

    Another point: you should avoid accessing the Excel application object from multiple threads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is my code, which takes two version identifiers in the form 1, 5,
Here we go again, the old argument still arises... Would we better have a
Here, i have coded to get data from DB. I want to store the
here's what I currently have, unfortunately I cannot seem to figure out how to
Here's the issue... if I use, say a directory catalog in MEF and have
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.