I have an Excel xlsm file which obviously contains macros. What is the alternative to using macros using aspose.cells? Could I re-write the macro using your API?
@simple2code,
See the document with example code for your reference and let us know your feedback.
Hope, this helps a bit.
so I cannot run functions or sub at all? Does it mean I have to convert all code in the modules into some sort of automation code? Will the excel file still calculate and do chart re-draws while I update the Excel data via aspose?
Yes, Aspose.Cells does not support to execuate or run macros/vba codes, so you have to convert all code using Aspose.Cells APIs accordingly. Aspose.Cells has its own formula calculation engine, you may even customize your re-calculations. Similarly, Aspose.Cells does draw charts or calculate its objects so you can directly take the image or render PDF for the chart present /drawn in the workbook without opening the output Excel file into MS Excel manually.
Thanks you for the response and I appreciate it a lot.
So if I use the Aspose.Cells API to convert the current code, I will be able to execute the same logic and update the cell data. Will I be able to call any Excel method like calculate to refresh the charts/graphs or is that even possible?
Yes, using Aspose.Cells, you can calculate formulas dynamically in the spreadsheet and get the calculated results against those formulas at runtime. Similarly, you may refresh/calculate pivot tables and charts dynamically in code. See some documents with examples for your reference:
[Formulas Calculations]
[Pivottable]
[Charts]
Thanks again, above really helps. I will need to do some testing and see what happens–
Sure, take your time to evaluate the samples and in the event of further queries or issue, feel free write us back, we will be happy to assist you soon.