Hi Zeeshan,
I’d recommend using the COM object model for this kind of thing (modifying the sheet from a macro context).
From inside your Excel-DNA Ribbon callback you get hold of the root COM Application object by calling ExcelDnaUtil.Application.
If your project has a reference to the Excel interop assembly Microsoft.Office.Interop.Excel.dll (or you’ve added the Excel-DNA.Interop NuGet package) you can directly cast the result of ExcelDnaUtil.Application to the Excel Application type. From there you use the object model as usual.
It would probably have more limited functionality in this case, but you could also use the C API call with the code xlcFontProperties to set the background. For details you’d need to consult the Excel macro help and look for FONT.PROPERTIES. Then you make the call from your Excel-DNA add-in using XlCall.Excel(XlCall.xlcFontProperties, …..)
You can download a .chm version of the macro help file here: http://www.xceed.be/Blog.nsf/dx/excel-macro-function-help-file-for-windows-7,
and a .pdf conversion of the whole file is here: https://www.codeplex.com/Download?ProjectName=exceldna&DownloadId=658244
Regards,
Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at http://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.