My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

17 July 2010

Add method of Styles class failed

by Patrik Luca 0 comments

Tag



Problem description: Add method of Styles class failed

Upon exporting some Dynamics AX data to Microsoft Excel, I ran into an Error, mentioning the cryptic Add method of Styles class failed.

Solution: Rename the added Style

I described in a previous post Export to Excel with X++ code: the sequel, how formatting can be added to the exported AX data in Excel by using the Styles class. This error message occurs when the collection object of the same class and name already exists, and you attempt to add it a second time with the same name. So apparently I had already a Style in my Microsoft Excel file with the same name as I was adding through my X++ code. I changed the name of my added Styles in my X++ code an my export went fine afterwards.

Comments 0 comments

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Subscribe feeds rss Recent Entries

Categories

Recommended Books


Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Live Traffic Feed

Recent Visitors

Blog Archive

My Blog List

Followers

Guest Links