Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Dear All,

I have created Windows application where automating MsOffice.

I have to evaluate inserted sparkline(would like fetch: type, theme, color, etc) in the excel worksheet(already exists).

What I have tried:

public static bool EvaluateSparkline(IQuestion question, string filename, string sheetName, string sparklineRange)
        {
            ExcelInterop.Application excelApplication = null;
            try
            {
                excelApplication = new ExcelInterop.Application() { Visible = false, DisplayAlerts = false, ScreenUpdating = false };
                ExcelInterop.Workbook excelWorkbook = excelApplication.Workbooks.Open(filename);
                ExcelInterop.Worksheet excelWorksheet = excelWorkbook.Sheets[sheetName];
                bool result = false;
                if (excelWorkbook != null && excelWorksheet != null)
                {
                    ExcelInterop.Range sparklineLocation = excelWorksheet.get_Range("F2"); ;
                    ExcelInterop.SparklineGroup sparkline = sparklineLocation.SparklineGroups.Item[1].Location;


                }

                excelWorkbook.Close();

                return result;
            }
            catch (Exception)
            {
                return false;
            }
            finally
            {
                QuitApplication(excelApplication);
            }
        }


Can anyone please help me, how to find out sparkline and its properties.


Thanks in advance.
Posted
Updated 10-Jul-17 22:24pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900