When using the ErrorBars property in Microsoft.Office.Core.IMsoSeries using COM automation, I get a COM exception "Interface not registered" while it works fine using the property within an add-in.
I noticed that the interface IMsoErrorBars is not registered in Windows Registry like all other Office API interfaces are (or at least the ones if have been using so far). I checked several machines with Office 2010 or 2013 installed and they all missed the IID {000C1721-0000-0000-C000-000000000046}
in HKEY_CLASSES_ROOT\Interface
.
Does anybody know why it's missing?
UDPATE
Here's as example in C# ...
IEnumerable<int> ErrorBarsColors(Microsoft.Office.Interop.PowerPoint.Shape shape)
{
var seriesCollection = shape.Chart.SeriesCollection() as IEnumerable;
foreach (Microsoft.Office.Core.IMsoSeries series in seriesCollection)
{
if (series.HasErrorBars)
{
var errorBars = series.ErrorBars;
yield return errorBars.Format.Line.ForeColor.RGB;
}
}
}
... that fails with the mentioned COM exception at the series.ErrorBars access when it's called in a stand-alone application using some code like this:
var application = new Microsoft.Office.Interop.PowerPoint.Application();
var presentation = application.Presentations.Open(SOME_PRESENTATION);
var shape = presentation.Slides[1].Shapes[1];
var colors = ErrorBarsColors(shape);
But the same code works perfectly when using it in a PowerPoint Add-In.
Meanwhile I found some other interfaces that neither are registered and show the same behavior.