Welcome to Office 365 APIs | Microsoft Docs
Skip to main content

Office 365 APIs

This site contains the documentation for Office 365 REST APIs exposed on the OneNote and Outlook endpoints. The documentation is no longer actively updated. It is here for your reference, in case you have already included any of the API in your project.

Office 365 services, such as OneNote, Outlook, Excel, OneDrive, Microsoft Teams, Planner, and SharePoint, are now exposed in Microsoft Graph. Microsoft Graph is a unified API endpoint for accessing data across Microsoft 365, which includes Office 365, Enterprise Mobility, and Security and Windows services. It provides a simplified developer experience, with one endpoint and a single authentication token that gives your app access to data across all these services.

Our recommendation:

  • If you are starting a new app, please use Microsoft Graph.
  • If you are maintaining an existing project, use this documentation set for reference. In addition, plan your move to the latest APIs in Microsoft Graph to take advantage of all the new functionality and innovation there.
  • If you are adding new functionality to an existing project, integrate that new functionality by using Microsoft Graph.

With Microsoft Graph, you can access Office 365 data and more, from solutions across mobile, web, and desktop platforms. So whether you're building web applications by using .NET, PHP, Java, Python, or Ruby on Rails, or creating apps for the Universal Windows Platform (UWP), iOS, Android, or on another device platform, it's your choice.

In this section

 none
C#, Excel Interop, & ExcelChartType.BoxAndWhisker RRS feed

  • Question

  • Hi,<o:p></o:p>

    I would like to make a Box and Whisker plot using C# and Excel Interop. The web
    tells me a Box and Whisker plot has ChartType set to ExcelChartType.BoxAndWhisker. Makes sense. But "BoxAndWhisker" is not a member of the ExcelChartType enumeration. <o:p></o:p>

    I can make I can make Box and Whisker plots manually in the Excel I have installed. I can make other types of charts using interop without problem. I am using the latest version of Interop I can find (Microsoft Excel 16.0 Object Library version 1.9.0.0; also Microsoft Office 16.0 Object Library version 2.7.0.0).  I recorded a macro of making a BoxAndWhisker Plot in Excel, checked the underlying value for ExcelChartType.BoxAndWhisker (seems to be 121) and tried casting that to ExcelChartType, but that gave a bad cast error. <o:p></o:p>

    Anyone know how to get this to work? I assume I need a different or additional reference, but I don't know what.<o:p></o:p>

    Thanks!<o:p></o:p>

    Ethan


    Ethan Strauss

    • Moved by CoolDadTx Thursday, March 21, 2019 1:50 PM Office related
    Wednesday, March 20, 2019 3:42 PM

All replies

  • Hi

    Thank you for posting here.

    >> tried casting that to ExcelChartType

    Could you provide the related code about your problem?

    >> but that gave a bad cast error.

    What is your bad cast error?

    We will be appreciated if you provide the above information.

    Best regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 21, 2019 3:23 AM
  • Hi,

       The code is below with the error indicated.

    Thanks,

    Ethan

            public static void MakeBoxPlot(Worksheet sheet, Range data)
            {
                double left=10;
                double width = 600;
                double top=10;
                double height = 200;
           
                ChartObject ch = ((ChartObjects)sheet.ChartObjects()).Add(left,top,width,height);
                ch.Chart.SetSourceData(data);
                ch.Chart.ChartType = (XlChartType)121;//This line throws an argument exception "Value does not fall within the expected range."
                foreach (XlChartType type in Enum.GetValues(typeof(XlChartType)))
                {
                    ExcelCell.PutValueAt(type.ToString(), "a1", sheet);
                    ch.Chart.ChartType = type;
                }
                ch.Chart.SetSourceData(data);
            }


    Ethan Strauss

    Thursday, March 21, 2019 3:47 PM
  • Hi, I have exactly the same problem, has any solution to that been found...?
    Thursday, April 4, 2019 8:44 AM
Welcome to Office 365 APIs | Microsoft Docs
Skip to main content

Office 365 APIs

This site contains the documentation for Office 365 REST APIs exposed on the OneNote and Outlook endpoints. The documentation is no longer actively updated. It is here for your reference, in case you have already included any of the API in your project.

Office 365 services, such as OneNote, Outlook, Excel, OneDrive, Microsoft Teams, Planner, and SharePoint, are now exposed in Microsoft Graph. Microsoft Graph is a unified API endpoint for accessing data across Microsoft 365, which includes Office 365, Enterprise Mobility, and Security and Windows services. It provides a simplified developer experience, with one endpoint and a single authentication token that gives your app access to data across all these services.

Our recommendation:

  • If you are starting a new app, please use Microsoft Graph.
  • If you are maintaining an existing project, use this documentation set for reference. In addition, plan your move to the latest APIs in Microsoft Graph to take advantage of all the new functionality and innovation there.
  • If you are adding new functionality to an existing project, integrate that new functionality by using Microsoft Graph.

With Microsoft Graph, you can access Office 365 data and more, from solutions across mobile, web, and desktop platforms. So whether you're building web applications by using .NET, PHP, Java, Python, or Ruby on Rails, or creating apps for the Universal Windows Platform (UWP), iOS, Android, or on another device platform, it's your choice.

In this section