My company is looking to update an old .Net WinForms application. In it we use VBScript to evaluate all kind of simple expressions. E.g.:

- Math calculation: +, - *, /, etc.
- String manipulations: Appending strings, replacing strings in a larger string, trim, etc.
- Verify a string exists in a larger string. E.g. Instr()
- Calculate dates, add subtract, and display results based in seconds, minutes, hours, etc.

Does Aspose have anything that could replace VBScript?

I would expect the syntax to be different. What we are concerned about is a wide variety of functions/evaluation types, and performance. It would need to execute faster than VBScript.

@instaknow,

If you target some file formats (e.g., XLS/XLSX, DOC/DOCX, PDF, PPT/PPTX, etc.) APIs, then Aspose SDKs could suit your needs well, The APIs are robust and efficient for all types of document processing and management. For example, Aspose.Cells is an MS Excel management API, it has an independent and robust formula calculation engine which supports almost all of the standard and advanced Microsoft Excel formulas/functions. You can read/write and calculate the results of the formulas on the fly with efficiency. All formula categories (e.g., Mathematical, String/Text, Logical, Statistical, Date and Time, Financial, Lookup and reference, etc.) are supported by Aspose.Cells.

See the documents on formula calculations for your rererence.

https://docs.aspose.com/cells/net/using-formulas-or-functions-to-process-data/

Let us know if we can be of any further help, we will be happy to assist you soon.

After testing out Aspose.Cells Worksheet.CalculateFormula() and extending the AbstractCalculationsEngine, it fulfills almost all our needs. The performance looks to be even better than the old VBScript.

Though, I have run into one roadblock in regards to commands like ‘AND’ and ‘OR’. In VBScript the syntax can be written like:

In Aspose.Cells (MS Excel) the syntax needs to be:

Is it possible to get the VBScript syntax for ‘AND’ and ‘OR’ to work in Aspose.Cells? I suspect not since it seems to be a core aspect of how the functions were designed by Microsoft. Maybe I overlooked something and you know of a way?

@instaknow,

Please note, Aspose.Cells follows MS Excel standards and specifications for setting formulas/functions, so you have to devise your formulas (for AND and OR expressions) in accordance with what MS Excel supports.