How do I calculate excel formula without opening excel?

Posted on 2009-04-24
Last Modified: 2013-12-17
Question: How do I calculate excel formula without opening excel (or Excel Process)?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dear Experts,

I have an excel formula... [=(C38+C36+C43+Sheet1!D13+Sheet2!C8)/1000]. This was inserted into Excel without using Excel application (it was done using a special .NET library) Unfortunately the .NET library does not support Macro... which means... these so-called 'formulas' are really inserted as texts & values, and without really opening this file in Excel it won't get re-calculated and saved, and so I am unable to read it's true result value.

Do I have to program an Engine that does exactly what Excel do? Or is there some other ways around it? Also, is there ways to read VBA macro without opening Excel?

PS: I cannot do the easiest... I cannot open Excel... this is because it's a web application, it will be ran on the server, used by multiple users at the same time...
Question by:scy501642229
    LVL 33

    Expert Comment

    How exactly was this inserted?

    Is some sort of automation of Excel being used?
    LVL 6

    Expert Comment

    Hi there,

    What version of Excel are you manipulating and what third-party Excel component are you using?

    Author Comment

    I am using Winnovative's Excel Library for .NET ( It works with all Excel version (97-2003, 2007). The way it was inserted was by first extracting the data from Excel to a database, then after running stored procedures through SQL Server Management Studio, I throw the table from database onto a DataTable. I then loop the datatable and insert them onto the Excel sheet.

    There is no automation involving any component of Excel / Microsoft Office / ADO.NET / InterOp / VBA. All of them are done using C#.

    The version I'm current on is 97-2003 (.xls), but this program is intended to run both .xls and .xlsx (97-2003, 2007).

    Author Comment

    The thing I'm really thinking for is Excel formula calculator

    I've already done all the coding that it will extract Excel Spread sheet, execute stored procedure and download it (select by user). However, in order to have all the formula calculated, I need to download and save it, then open it using Excel (because it re-calculates all formula when it starts by default), then save the "re-calculated" version even though I didn't do a thing.

    What I'm looking for is either some hints & direction as to where to find this Excel formula calculator.
    LVL 6

    Expert Comment

    I did a lot of searching, but I couldn't find a solution for you. There are other Excel libraries that will do recalculations, but obviously you can't change course now.

    I'm sorry I couldn't help.

    Accepted Solution

    Its ok, I also founded other Excel library that does formula calculations... the problem is that the cost is too high... which means I might just have to write the calculator myself... thanks though.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now