We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can Aspose.Cells run Macros?


I originally sent out this email to sales@aspose.com but, for some weird reason, they told me to post this question in the public forum instead of providing me with sales information about the product so…here goes.

We’re looking for a solution we can integrate into our product to solve a couple of products we’re having and came across the Aspose.Cells product, so I wanted to know if it can potentially solve our problems.

Basically, one of the features in our product is the ability to associate an Excel spreadsheet with our product, so that when complex calculations are required we can rely on Excel to run any custom macros the customer might have and calculate the outputs for us.

The way it works is simple:

  • We let the user associate an Excel spreadsheet with a template, as well as the inputs to provide to the Excel doc (e.g. our property_x will be input as Cell X1)
  • When it is necessary, we launch Excel (either in the foreground or background) so it can run the macros associated with the file
  • And, lastly, we read back results produced by the Macro and import that output data into our product

However, there are a few problems with this approach:

  • It requires a full Excel user license in order for us to be able to launch Excel and that is very costly to our customers
    • It is not a big problem for the regular desktop product BUT it becomes a problem when we do hosting for our users, where we need to have them pay for ANOTHER Excel license just to have the feature work when needed
  • I want to avoid relying on an executable to run external code
    • And, now that we’re moving to a web platform, I’m not sure we’ll be able to properly run Excel in the background from a Windows Service, so I’m worried about it

So what I’m looking for is the ability to programmatically run Macros on an arbitrary Excel spreadsheet without having to launch .exe files OR requiring a full copy of Excel.

Is this something Aspose.Cells can help us with? If so, what is the cost associated with it and can we setup a sales call to see a demo of it and ask technical questions?

p.s. our product is developed in a mix of VB6 and .NET so, at a minimum, we need a .NET capable API!
Also, REST APIs are highly desirable to me.

Thank you!


Thanks for the details.

You can use Aspose.Cells to accomplish all the tasks except running or executing macros. I am afraid, currently, Aspose.Cells does not support to execute/run vba codes or macro functions although we have supported to create, manipulate or embed VBA codes/ macros. We still however could not support to run or execute macros or vba code. For your information, Aspose.Cells is a spreadsheet management library/APIs used to manage or manipulate MS Excel spreadsheets using its file formats, i.e., XLS, XLSX, XLSM, XLSB, CSV, SpreadsheetML, ODS, etc. It supports almost all the features of MS Excel (2003 - 2013/2016). It also supports some other useful features like Excel to PDF, Excel to HTML and Sheet to image features. I think currently, you may try to use/set Custom Functions (if in those macros you manipulate some custom oriented formulas/functions) to support your requirements by Aspose.Cells API if it could suit your needs, see the documents for your reference here:

We are very sorry for any inconvenience caused!

Hi Team,

Is there any update on enabling the macro execution in Aspose Cells.



I am afraid, the feature is still not supported.

Do we have macro support now with the latest releases of aspose cell (Java) ?


No, executing/running macros/vba codes feature is still not supported in Aspose.Cells. Aspose.Cells only allows to create, manipulate or embed VBA codes/ macros. We think you may try to use/set Custom Functions (if in those macros you manipulate some custom oriented formulas/functions) to support your requirements by Aspose.Cells API, see the documents for your reference here:
Using ICustomFunction Feature
Implement Custom Calculation Engine to extend the Default Calculations

@Amjad_Sahi, when using the custom calculation engine, would our customers need to also license Aspose?

Basically, we want to give our customers the ability to add their own custom code to their spreadsheets but, given the only option is to do it via an ICustomFunction, does an ICustomFunction developer need an Aspose license to create a custom function?

Thank you,


If you already have a valid Aspose.Cells license, you may use that one. If you do not have a valid license, you need to purchase it to use the APIs (for your desired features) which Aspose.Cells provides.

Your understanding is correct.

Is the feature available as of the latest version of aspose.cells python via .NET?
I want to run the macro present in a worksheet
I want to replicate this functionality of win32com.client which is: Workbook.Application.Run(“abc_macro”)


Executing/running macros/vba codes feature is still not supported in Aspose.Cells yet, and we are afraid there is no plan to support it in near future. We think currently maybe you can implement those operations in your macro with the apis of Aspose.Cells by yourself.