Excel Chart : operations on series using active X

I use Active X to display XY graphs and its corresponding data on an excel sheet but i have difficulties playing with the series.
For example, the first graph corresponds to f(B)=A where A and B are excel columns, and the second corresponds to f(C)=A.
Unfortunately, on the second graph, the first serie f(B)=A appears even if I specify the correct range in SourceData. i tried to delete it with the Series Collection but i don't really know how to use this node with Labview.
Following is the VBA script :
Sub Macro2()
    Range("A1:A4,C1:C4").Select
    Range("C1").Activate
    Charts.Add
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.SetSourceData Source:=Sheets("Feuil1").Range("A1:A4,C1:C4"), _
        PlotBy:=xlColumns
    ActiveChart.SeriesCollection(1).Delete
    ActiveChart.SeriesCollection(1).XValues = "=Feuil1!R1C1:R4C1"
I would be glad if i could get the graph corresponding to the specified range...and if someone can explain me how to use the SeriesCollection to be able to rename my series, delete some, etc...
Thanks!!
Chris

Found the solution on this thread : http://forums.ni.com/ni/board/message?board.id=170​&message.id=142170&query.id=1860717#M142170
I was giving bad arguments to XValues and Values...

Similar Messages

  • How to specify the excel sheet you wanted while using Active X

    could anyone tell me how to name or append to specific the excel sheet? i do not know where and how to set the path for it.

    Hi Gorka, could you describe a bit more, on the setting of page before or after adding? Do you use a string or numeric to set the parameter, and if i want the datas to be set to say, workbook (project.xls), sheet 2, how would you set it? I tried to use index, rather than add method, and when i set the index to 0, the datas will be at sheet 1, and for other index numbers, there would be an error of code 1.

  • Excel Chart Header/Footer

    I am having a really hard time trying to write to the chart header and footer using Active X.  I have an excel file that I want to use as a template to write my data to.  In this file I have some sheets and some charts that have their source data tied to a sheet and the cells on the sheet.  I can write my data through Active X to the sheets and enter my header and footer without a problem.  I can even select the the charts and print them, but when I try to write headers and footers to the charts nothing happen.  I get no error messages or anything.  I currently select the chart and then use the PageSetup property to write to the header information just like I am doing for the individual sheets, but for some reason this does nothing.  Also I tried changing the chart title and stuff like that and I get nothing too.  Can anyone tell me what I am doing wrong?  I can't seem to figure out what I am missing.

    Sorry for the late response, my code are on my computer at work so I couldn't respond over the weekend.  Here is a copy of the spreadsheet and the code I use to write to the sheet's header/footer and the code for writing to the chart's header/footer.  Please let me know what is wrong and if you need anything else from me.  Thank
    Tom
    Attachments:
    Book1.xls ‏106 KB
    Write_Header_Footer.vi ‏53 KB
    Write_Chart_Header_Footer.vi ‏71 KB

  • Excel chart

    Is there a way to define multiple series when using LabView ActiveX? I found a SeriesCollection method and a datacollection method, anybody knows how these works. Also, I found that in the Chart Set Source method and ChartWizard, you can only connect one Source to it. So is there anyway to tell excel to graph multiple series using LabView ActiveX? Thanks in advance

    Hi
    This is the forum to discuss questions about Microsoft Excel develop. For your question is not about Excel develop, I am moving this thread to the TechNet forum for Excel
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Powershell Excel Chart - change series colors

    I have a Powershell script that reads values from an Excel sheet and then creates a chart based on the values. The script works but I want to change the colors of the series in the bar chart. In VB (using an Excel macro) the code is as follows:
    ActiveChart.SeriesCollection(7).Select
    With Selection.Format.Fill
    .Visible = msoTrue
    .ForeColor.RGB = RGB(17, 17, 17)
    .Solid
    End With
    Based on what I read Powershell doesn't process RGB colors so I tried using one of the default colors:
    $wb.ActiveChart.SeriesCollection(5).Format.Fill.ForeColor = "black"
    Whatever variation on this I try seems to make no difference to the color of the bar chart series values. Is it even possible to change the colors with Powershell?

    Hi,
    Based on my research, the below code should be used to change chart forecolor, please give it a try:
    $chart.SeriesCollection(1).Points(1).Format.Fill.ForeColor.RGB = 255
    More details please go through the below link:
    http://learn-powershell.net/2012/12/24/powershell-and-excel-adding-a-chart-and-header-filter-to-a-report/
    Regards,
    Yan Li
    Regards, Yan Li

  • Having trouble formatting excel chart using Chart Wizard command.

    Problem Description :
    Trying to create an excel chart derived from an excel spreadsheet. Having trouble understanding the parameters to format in the Chart Wizard function to get the desired results. There are no error messages, just chart is not what expected.
    Goal:
    Chart with temperature on the left, y-axis. 3 lines on the graph for min meas temp, avg meas temp, max meas temp.
    Bottom x-axis should contain year/month values.
    Chart Wizard command:
    status = ExcelRpt_ChartWizard (chart_temperature_handle, chart_data_worksheet_handle, D1:G3, ExRConst_GalleryLine, ExRConst_Rows, 0, 0, 0, 1, "Temperature Stats", "Year/Month", "Temp F", NULL)
    NI Software : LabWindows/CVI version 8.0.1
    NI Hardware : None device
    Driver Version :
    OS : Windows XP
    Customer Information :
    Mary Claflin
    Technology Kitchen Corporation
    US
    [email protected]
    Ph: (512) 965-4722

    Hi Mary,
    Looking at the Chart Wizard within Excel, it appears as though the only
    chart type that allows us to give a series of values for our XAxis
    would be the XY Scatter plot. There IS an option for this when using
    the CVI Excel Report function calls (specifying
    ExRConst_GalleryXYScatter for the plot type).
    However, it appears that there are not any Excel report chart functions
    available in CVI to specify anything other than the general "series"
    object. When this object is sent through as a variant data type to
    Excel, Excel appears to automatically convert this single object into
    separate data series. This is because Excel is not immediately aware
    that we are attempting to use a Scatter plot, and thus must convert
    each column into a separate series. There is no object defined in the
    Excel report that would be able to handle the "Xseries" and "Yseries"
    option that are seen in the chart creation wizard within Excel. Thus,
    we have no way of specifying a different set of data for our XAxis.
    It appears as though, at least for our own CVI functions, that there is
    no way to accomplish your goal. Since CVI is based around C - we CAN
    call any ActiveX client registered on the system. Because of this, we
    should be able to talk with Excel directly without the help of the CVI
    Excel Report functions, although this may be more difficult.
    I haven't been able to find any specific C example code, but here is
    the Excel Object Model on which calls to Excel will most likely be
    based:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrconexcelobjectmodeloverview.asp
    Sorry for the inconvenience Mary.
    Dan Weiland

  • Change the x-axis series in excel chart

    Hi,
        While plotting an Excel chart using ExcelRpt_ChartWizard(), the x - axis series starts from 0, 1, 2, 3... I like to change the series according to the data present in a particular column. Eg. If column 2 contains 2, 5, 7, 6.2... then the x-axis should be in the order 2, 5, 7, 6.2.....
    Can anyone help me regarding this issue?

    Hi,
    Many thanks for this post, It's been quite helpful since there seems no to be so much info available about not so basic generation and manipulation of excels graphs with LabWindows (at least compared to C#).
    I am struggling to set my own X-Axis as well but the best I can get is the graph looking like the one of the attached file.
    The first row for the X-Axis is 11:47:00 and the last one is 17:46:25, however I get a graph between 0:00:00 and 19:12:00.
    May thanks,
    Best regards
    Attachments:
    Graph with LW.png ‏14 KB

  • How to use active X controls to read/write protect an excel or word document created by created by Save Report to File VI

    Hi all,
    I'm trying to creat a word and excel documents using Save Report to File VI. When wiring a password to this last VI, the document created are only protected against writing but not reading. How can I use active X controls to password protect these documents against reading?
    Thanks a bunch!
    O

    There is no predefined functionality available in LabVIEW. So you have to implement this on your own.
    It seems to me that you own the Office Report Generation Toolkit. You can use the Excel Get ActiveX References.vi from the Excel Specific >> Advanced palette to get access to the "generic" ActiveX Excel references. Starting from this point, you can use property and invoke nodes to get to the setting you are going to modify.
    Please refer to this link for information on Excel password protection. I have not searched for the object giving you access to those settings though....
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to use ActiveX Microsoft Office Excel Chart?

    Does anyone know how to use "ActiveX Microsoft Office Excel Chart" from CVI 7.0? I tried with following code but it did not draw anything.
    HRESULT MakeChartInExcelActivexCtrl(void)
    HRESULT error = 0;
    char szErrMsg[256];
    // Create a new chart with its own worksheet
    // ExcelRpt_ChartNew(workbookHandle,-1,&chartsheetHandle);
    SetWaitCursor (1);
    // Open new Range for Worksheet
    error = CA_VariantSetCString (&MyCellRangeV, EXCEL_ARRAY_OF_CELLS);
    error = Excel_WorksheetRange (ExcelWorksheetHandle, NULL, MyCellRangeV, CA_DEFAULT_VAL, &ExcelRangeHandle);
    CA_VariantClear(&MyCellRangeV);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    error = Excel_GetProperty (excelChart, NULL, Excel_WindowActiveChart, CAVT_OBJHANDLE, &ExcelChartHandle);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    // Create a XY scatter chart using the data we wrote to the worksheet as its data source.
    error = ExcelRpt_ChartWizard(ExcelChartHandle, ExcelWorksheetHandle, EXCEL_ARRAY_OF_CELLS,
    ExRConst_GalleryXYScatter, ExRConst_Columns, 0, 0, 0, 0, "Filtered Data Chart", "",
    "Weather Data", NULL);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    // Change the plot lines to not display markers and smooth out
    // the plot lines. This is one of the plot styles available in Excel.
    error = ExcelRpt_SetChartAttribute (ExcelChartHandle, ER_CH_ATTR_CHART_TYPE, ExRConst_XYScatterSmoothNoMarkers);
    if (error<0)
    CA_GetAutomationErrorString(status, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    Error:
    SetWaitCursor (0);
    CA_VariantClear(&MyCellRangeV);
    CA_VariantClear(&MyVariant);
    ClearObjHandle (&ExcelRangeHandle);
    ClearObjHandle (&ExcelChartHandle);
    ClearObjHandle (&ExcelChartObjHandle);
    ClearObjHandle (&ExcelChartsHandle);
    if (error < 0)
    ReportAppAutomationError (error);
    return 0;
    Attachments:
    excelActivexCtrl.zip ‏4692 KB

    I use C:\Program Files\National Instruments\CVI90\toolslib\activex\excel\excelreport.fp to  build/modify excel report.there is very detail configuration in this function moudule , hope it can help you 
    Sonic
    Diffrent Strokes for Different Folks

  • Error -2146960888 when opening excel from labview using active x

    attempting to open an instance of excel from labview using active x, I even tried using the "open excel and make visible.vi" found on this site. I get errors every time, Inserting a break right after the property node, I found that it does open excel with no active workbook. once the program runs to ompletion excel terminates. The error is on the line right after the property node executes.

    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3F15456A4E034080020E74861&p_node=DZ53003&p_submitted=N&p_rank=&p_answer=&p_source=External
    Attachments:
    XL97table.zip ‏29 KB

  • Closing an excel sheet using active X%3F

    I am working with report generation toolkit.
    Before generating the report I'm trying to close all the excel sheets using Active X. At times the excel application gets closed without asking for the save or dont save option.
    What change should I do in the code?
    Please find the attached code
    Solved!
    Go to Solution.
    Attachments:
    PRJA1832_Dispose all Excel.vi ‏15 KB

    Hi,
         Thanks for the help.
    The VI is still not consistent at times. It closes without saving even if I'm using display alerts. I'm also getting an error when i keep running the code. And I think the error is because the excel sheet is maximised and I'm running the code. Please find the attached snapshot of the error.
    Regards
    Hridhya
    Attachments:
    Report disable alerts.png ‏51 KB

  • Defining a scatter chart with multiple series

    I am trying to create a scatter chart with two series.  I am using CR8.5 and CR2008.
    I am having difficulty with my data being presented correctly when I attempt to define the scatter chart.  The data is temperature and weather use/sqft for two different years.
    Year Period Temp Energy Use/sqft      Year Period Temp Energy Use/sqft
    2012 1/2012  52  3.7172               2013 1/2013  52  3.1712
    2012 2/2012  62  3.7015               2013 2/2013  57  3.1449
    2012 3/2012  70  3.7937               2013 3/2013  63  3.2039
    2012 4/2012  76  3.9882               2013 4/2013  71  3.4551
    2012 5/2012  82  4.2213               2013 5/2013  81  3.9903
    2012 6/2012  87  4.4875               2013 6/2013  85  4.3650
    2012 7/2012  90  4.4727               2013 7/2013  87  4.2072
    2012 8/2012  86  4.6154               2013 8/2013  87  4.2560
    I would expect to see something similar to the attached images of an excel files scatter chart.  When I defined the scatter chart in Crystal Report, I need to define a field for 'On change of', and 2 'Values to show'.
    I understand that this would not show the expected scatter chart but I went this direction as the series is to be the year.
    On change of:
    - Year
    Show values:
    - Temp
    - Energy Use/Sqft
    Problem is the sum of both is being shown. I am trying to keep the series together by year and showing each record as retrieved from the database.
    Thank you,
    Jim

    You can try using this charting tool for generating scatter charts:
    http://htmldb.oracle.com/pls/otn/f?p=31517:58
    Denes Kubicek

  • Excel chart - create second axis

    I've created a script which makes an Excel object, takes some data, generates a chart and then exports the chart as a JPG. The thing is it's a CPU report with one series for Mhz and one for % - and using only one axis results in it ending in the thousands
    and not being able to see the second series. Do you know how to specify a second axis on the right-hand side (left for Mhz right for %) which would only go up to 100? I don't even know how to do it in Excel, never mind PowerShell.
    Thanks in advance. Oh yeah, here's my code:
    # Generate graph
    $xRow = 1
    $yRow = $rows
    $objRange=$Worksheet.range("a${xRow}:c${yRow}")
    $colCharts=$excel.Charts
    $objChart=$colCharts.Add()
    $objChart.ChartType=4
    $objChart.Axes(0).CategoryType=2
    $objChart.Axes(0).TickLabelSpacing=7
    $objChart.HasTitle = $true
    $objChart.ChartTitle.text = "CPU Report"
    $a=$objChart.Activate
    $savepath = "C:\"
    $a=$objChart.export($savepath + "cpu.jpg","JPG")

    Hi Bobbinspenguin,
    If you want to add a second series in Excel chart with powershell, please refer to this article:
    Tutorial: PowerShell and Microsoft Chart Controls (or How To Spice Up Your Reports)
    I hope this helps.

  • Excel chart default font

    Hi,
    by default new charts in Excel use the  body text font from the selected theme. Is it posible to get the chart to use the theme heading font as default instead? Most of my clients want their heading font for charts instead of the body text font, whitch
    makes it difficult to create a theme that works in both Word and Excel.
    Regards, Åsa

    Hi,
    I'm sorry for my misunderstanding, I wand to confirm your requirement. According to your description, my understanding is that you need to use headings font instand of the body text font in Excel chart.
    Here is two workarounds, please try them:
    1.Customize the Theme in Page layout Tab > Save as template
    http://office.microsoft.com/en-gb/excel-help/change-the-default-theme-HA010204550.aspx
    2.Use a macro. It will help you apply the format after you creating the chart.
    Note:  We need to change the font and size before using it.
    Sub ChartTitleFont()
    'Prevents screen refresh whilst macro executes
    Application.ScreenUpdating = False
    'Run the Error handler "ErrHandler" when an error occurs.
    On Error GoTo Errhandler
    Dim ChartList As Integer
    Dim x As Integer
    ' Variable chartlist stores a count of all embedded charts.
    ChartList = ActiveSheet.ChartObjects.Count
    ' Increments the counter variable 'X' in a loop.
    For x = 1 To ChartList
    ' Selects the chart object.
    ActiveSheet.ChartObjects(x).Select
    ' Makes chart active.
    ActiveSheet.ChartObjects(x).Activate
    ActiveChart.ChartTitle.Select
    Selection.AutoScaleFont = True
    With Selection.Font
    .Name = "Calibri Light (Headings)"
    .FontStyle = "Regular"
    .Size = 20
    End With
    Next
    Errhandler:
    End Sub
    Regards,
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Line Chart with Multiple Series

    Post Author: JayZee
    CA Forum: Charts and Graphs
    HI
    I am trying to create a line chart with multiple series for trend analysis on CR XI but not having much luck, I thought it would be so simple to do!
    My data is provided summarized on the server and is returned as 12 rows:
    Month       Year1        Year2      Year3      Year4     Year5January      100           80          75           90          120February      85           25           40           25          80etc for the rest of the months
    My problem is that I can only get the chart to accept the values to display as a summary and not just as the data pulled back from the server.  I have read an article on the support site for Crystal 6.0  but it doesn't seem to translate well into XI.
    If necessary I could redesign the table to bring back un-summarized data but that is quite a big job.
    Any help greatly appreciated.
    Jay

    Post Author: Tim Wise
    CA Forum: Charts and Graphs
    In the chart expert, put Month in the 'On change of' box and put each year in the 'Show values' box. This puts the month on the x-axis and plots each year as a line.
    Is that what you want?
    I did this in CR 2008 using your data in an Excel sheet.

Maybe you are looking for