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

Free Support Forum - aspose.com

Aspose word $!Syntax Error, < / Comma seperated numbers


we are using the latest verion of aspose word (17.12).

when i try to do a sum of merge fields in word , i get a “$!Syntax Error, <” error. when i click on edit and open the formula it is =(*) which is straight forward. is there anything wrong with the formula.

Also i think that this is happening because openingbalance number might have numbers in comma seperated format (eg 123,465,789). when i try to remove the comma’s it seems to have worked. unfortunately i cant have the source file changed as they are locked. is there something i can do about in the aspose word library to replace those commas or the formula itself?


Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Provide information about your specific culture, such as the name of the culture, language and country/region.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi tahir.manzoor,

Thank you for getting back to me on this. I have attached a standalone application which reads a test document. Aspose.zip (86.1 KB)

Attached final output as well where I see syntax error.

Note : when we open the TextDocumentNew.docx and edit the field which says syntax error and just say ok, then the number is displayed in the word. but the formula is all correct and we do not have any issues. TestDOcument.docx has the actual fields with actual formulas.

please let me know if I can provide more information


Thanks for sharing the documents. Please call Document.UpdateFields method before saving the document to fix this issue. This method updates the values of fields in the whole document.

Document doc = new Document(MyDir + "TestDocumentNew.docx");
doc.Save(MyDir + "output.pdf");

Thank you Tahir.Manzoor. seems like I could resolve this issue on my test script. I will verify on the actual code and hopefully this should fix.

Thanks again for your quick response and your time!!!

Hi Tahir,

Thanks for your earlier replies where it worked like charm.

We have run into a different issue in one of the hidden formula in a word document (attached). when we use Aspose dot net word latest version to convert this into PDF and it gives me a syntax error again . please see the attached word documentTest.zip (69.1 KB)


Thanks for your inquiry. Please note that Aspose.Words mimics the behavior of MS Word. The formula field in your document has syntax error. If you update the field and convert document to PDF using MS Word, you will get the same output.