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

Free Support Forum - aspose.com

Support Macros

Dear there,

Hope everything is being good, then;

Please let me know if Macros is supported in .doc, .xls ?
And if yes, let me know if there is any limitation like using the custom property more than one time in the same document file ?

Please list all the limitation while using macros in word and excel documents.

Best Regards!

Hi Anas,


Thank you for contacting support. In reference to the Word documents, Aspose.Words API does not support all types of the Macros. It only preserves Macros on open and save operations.

In reference to the Excel documents, Aspose.Cells API has added support of Macros. You can add and manipulate Macros. The limitations would be the same as of the Microsoft Office Excel. Aspose.Cells API mimics the behavior of Microsoft Office Excel. Please refer to these help topics: Adding VBA Module and Code using Aspose.Cells, Modifying VBA or Macro Code using Aspose.Cells and Add a library reference to VBA project in the workbook

Dear Imran,

Can you tell me the supported Macros in .doc also I want to know more about the not supported Macros ?

Best Regards!
Anas Quedan

Hi Anas,


With latest version of Aspose.Words 16.12.0, you can do the following:

Document.HasMacros Property: It returns true if the document has a VBA project (macros).
Document.RemoveMacros Method: It removes all macros (the VBA project) as well as toolbars and command customizations from the document.

FormField.EntryMacro Property: It returns or sets an entry macro name for the form field.
FormField.ExitMacro Property: It returns or sets an exit macro name for the form field.

FieldMacroButton Class: It implements the MACROBUTTON field and allows a macro or command to be run. See class members for more details.
http://www.aspose.com/api/java/words/com.aspose.words/classes/FieldMacroButton

Hope, this helps.

Best regards,

Dear Hafeez,

Thanks for your quick response, but I’ve a one more question;

If we have the same custom property field used multiple times in .doc file, Does Aspose words support that kind of Macros ?

And is there any plan to support all Macro types?

Best Regards!
Anas Quedan

Hi Anas,


Can you please elaborate your usecase in detail? What do you mean by Support of Macros in .doc? Do you want to Insert new Macros or Move existing Macros in Word? Do you want to Run Macros?

What Aspose.Words currently can do is, if your input Word document has Macros and when you save it using Aspose.Words, those Macros will remain preserved in output Word document.

Best regards,

Hi Awais,

Sure I’ll. I want to run Macros (run VBA project) in word document (.doc) and sync custom property where it’s mentioned in the document.

Giving more details: Please check the attached document below and the scenario is: in our system we made an OI with our system then the properties value will be reflected in a custom property so that the value must appear where that custom property mentioned in the document. And here in my case while I have a custom property mentioned multiple times in the document then that value will appear only one time not wherever it’s mentioned.

Please advise.

Best Regards!
Anas Quedan

Hi Anas,


Thanks for your inquiry. We have logged this requirement in our issue tracking system. The ID of this issue is WORDSNET-14639. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for any inconvenience.

Best regards,

Dear Awis,
Hope everything is being good, then;

I want to know when this will be solved since it’s an urgent issue.

Best Regards!
Anas Quedan

Hi Anas,

Thanks for your inquiry. Unfortunately, your issue is not resolved yet and it is in the queue. I am afraid, we can't provide you any reliable estimate at the moment. We will inform you via this thread as soon as this issue is resolved. Sorry for the inconvenience.

Best regards,