Hi,
We would like call some macro from this products SPC Software for Excel | SPC Excel Add-in | PC and Mac | QI Macros
After we’ve installed this product, all the macros are available in the menu.
How can we call these macros using Apose.Excel?
Please advise.
Thanks.
Hi,
Aspose.Excel doesn’t support calling macros in an Excel file now. It supports to import the template file which have macros. You can change data/formating/… in the file and generate the result file. The macros are reserved.
@cheeching,
Aspose.Excel is discontinued and no more supported now. You may use Aspose.Cells now which contains all the features supported by the previous product along with the latest features available in all versions of MS Excel. You can perform variety of operations using Aspose.Cells like modifying the VBA macros as demonstrated in the following sample code:
// Create workbook object from source Excel file
Workbook workbook = new Workbook(dataDir + "sample.xlsm");
// Change the VBA Module Code
foreach (VbaModule module in workbook.VbaProject.Modules)
{
string code = module.Codes;
// Replace the original message with the modified message
if (code.Contains("This is test message."))
{
code = code.Replace("This is test message.", "This is Aspose.Cells message.");
module.Codes = code;
}
}
// Save the output Excel file
workbook.Save(dataDir + "output_out.xlsm");
Here is a list of features available in this product:
- Password Protect the VBA Project of Excel Workbook
- Find out if VBA Project is Protected
- Check if VBA Project is Protected and Locked for Viewing
- Modifying VBA or Macro Code using Aspose.Cells
- Adding VBA Module and Code using Aspose.Cells
- Assign Macro to Form Control
- Check if VBA project in a Workbook is Signed
- Add a library reference to VBA project in workbook
- Export VBA Certificate to File or Stream
- Check if VBA Code is Signed
- Digitally Sign a VBA Code Project with Certificate
- Check if Digital Signature of VBA Code is Valid
- Copy VBA Macro UserForm DesignerStorage from Template to Target Workbook
- Filter VBA Project while loading a workbook
For testing purpose download the latest version here:
Aspose.Cells for .NET (Latest Version)
A ready to run solution is available here.