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 7727837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:33:48+00:00 2026-06-01T05:33:48+00:00

Given a workbook with cross-sheet formulas generated by Coldfusion 9 via Apache POI .

  • 0

Given a workbook with cross-sheet formulas generated by Coldfusion 9 via Apache POI.

I want to programmatically force an entire workbook to do a “full calculation with dependency tree rebuild” before saving the workbook to disk.

So that when my end-users open the spreadsheet, they do not have to press Ctrl–Alt–Shift–F9.

How do I accomplish this in coldfusion?

References:

  • http://adobe.ly/HbLBZo
  • http://poi.apache.org/spreadsheet/eval.html
  • http://bit.ly/HJJA3Q
  • 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-06-01T05:33:49+00:00Added an answer on June 1, 2026 at 5:33 am

    Unfortunately there is no easy answer to this one.

    Option 1:

    I think the shortest route is to use CreationHelper.createFormulaEvaluator().evaluateAll(). Unfortunately, it is not available in CF9. That method was added in a later version of POI than the one shipped with CF9. The same applies to setForceFormulaRecalculation(). You could probably use the JavaLoader.cfc to load a newer version of POI. Then you would have access to those methods. But that may be more involved than you want for this one task.

    Option 2:

    Failing that, if you know the proper sequence you could iterate through the sheets and recalculate the formulas for each one:

    wb = sheet.getWorkBook();
    evaluator = wb.getCreationHelper().createFormulaEvaluator();
    // you could also use an array of sheet names instead
    for(sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) {
        poiSheet = wb.getSheetAt(sheetNum);
        rows = poiSheet.rowIterator();
        while (rows.hasNext()) {
            r = rows.next();
            cells = r.cellIterator();
            while (cells.hasNext()) {
                c = cells.next();
                if (c.getCellType() == c.CELL_TYPE_FORMULA) {
                    evaluator.evaluateFormulaCell(c);
                }
            }
        }
    }
    

    Option 3:

    Another possibility is to populate a template with a macro which automatically recalculates when the workbook opens. The obvious disadvantage is it relies on a macro. But since it is performed by Excel itself, it is probably the most reliable/robust option.

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

Sidebar

Related Questions

My question is as follows: I have given a workbook to multiple people. They
I have an Excel Workbook which has some VSTO-based c# code. Given a known
Given the following code: using Aspose.Cells // {...} Workbook workbook = new Workbook(); Worksheet
So, in a Workbook, I have two worksheets: One has a table full of
The first sheet of my workbook is like a contents page. Each cell in
I'm trying to call an Excel macro that's in another workbook. It's a sheet-specific
I want to populate some cells given certain condition. The thing is, I have
I've got this Excel Workbook which I want to search for a specific string
Given a specific DateTime value, how do I display relative time, like: 2 hours
Given a Python object of any kind, is there an easy way to get

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.