<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Amending excel graph data ranges in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50943#M6094</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;I am trying to create a vbo to change the data range for the XValues of a chart object in excel. I have it doing everything I need except it doesn't recognise the range value when its passed into the object as a parameter. Here's what I have so far&lt;BR /&gt;&lt;BR /&gt;Dim sw, dw As Object&lt;BR /&gt;Dim ss, ds As Object&lt;BR /&gt;Dim excel, sheet, source, workbook, range As Object&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;sw = GetWorkbook(CInt(Handle), Source_Workbook)&lt;BR /&gt;ss = GetWorksheet(CInt(Handle), Source_Workbook, Source_Worksheet)&lt;BR /&gt;sw.Activate()&lt;BR /&gt;ss.Activate()&lt;BR /&gt;excel = ss.Application&lt;BR /&gt;sheet = excel.ActiveSheet&lt;BR /&gt;workbook = excel.ActiveWorkbook&lt;BR /&gt;&lt;BR /&gt;sheet.ChartObjects(Chart_Name).Activate()&lt;BR /&gt;workbook.ActiveChart.FullSeriesCollection(1).XValues = workbook.Sheets(Source_Worksheet).Range(Source_Range)&lt;BR /&gt;&lt;BR /&gt;Success = True&lt;BR /&gt;Message = Chart_Name &amp;amp; " successfully updated"&lt;BR /&gt;&lt;BR /&gt;Catch e As Exception&lt;BR /&gt;Success = False&lt;BR /&gt;Message = e.Message&lt;BR /&gt;Finally&lt;BR /&gt;sw = Nothing&lt;BR /&gt;ss = Nothing&lt;BR /&gt;dw = Nothing&lt;BR /&gt;ds = Nothing&lt;BR /&gt;excel = Nothing&lt;BR /&gt;sheet = Nothing&lt;BR /&gt;source = Nothing&lt;BR /&gt;&lt;BR /&gt;End Try&lt;BR /&gt;&lt;BR /&gt;If I defined the value specifically it works fine e.g. workbook.ActiveChart.FullSeriesCollection(1).XValues = "=Sheet1!$A$2:$B$2"&lt;BR /&gt;&lt;BR /&gt;But obviously I would want to pass the range value as a parameter to make it dynamic. I know I'm missing something obvious here but I just cant put my finger on it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Technical lead developer&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Thu, 10 Sep 2020 15:24:00 GMT</pubDate>
    <dc:creator>michaeloneil</dc:creator>
    <dc:date>2020-09-10T15:24:00Z</dc:date>
    <item>
      <title>Amending excel graph data ranges</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50943#M6094</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I am trying to create a vbo to change the data range for the XValues of a chart object in excel. I have it doing everything I need except it doesn't recognise the range value when its passed into the object as a parameter. Here's what I have so far&lt;BR /&gt;&lt;BR /&gt;Dim sw, dw As Object&lt;BR /&gt;Dim ss, ds As Object&lt;BR /&gt;Dim excel, sheet, source, workbook, range As Object&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;sw = GetWorkbook(CInt(Handle), Source_Workbook)&lt;BR /&gt;ss = GetWorksheet(CInt(Handle), Source_Workbook, Source_Worksheet)&lt;BR /&gt;sw.Activate()&lt;BR /&gt;ss.Activate()&lt;BR /&gt;excel = ss.Application&lt;BR /&gt;sheet = excel.ActiveSheet&lt;BR /&gt;workbook = excel.ActiveWorkbook&lt;BR /&gt;&lt;BR /&gt;sheet.ChartObjects(Chart_Name).Activate()&lt;BR /&gt;workbook.ActiveChart.FullSeriesCollection(1).XValues = workbook.Sheets(Source_Worksheet).Range(Source_Range)&lt;BR /&gt;&lt;BR /&gt;Success = True&lt;BR /&gt;Message = Chart_Name &amp;amp; " successfully updated"&lt;BR /&gt;&lt;BR /&gt;Catch e As Exception&lt;BR /&gt;Success = False&lt;BR /&gt;Message = e.Message&lt;BR /&gt;Finally&lt;BR /&gt;sw = Nothing&lt;BR /&gt;ss = Nothing&lt;BR /&gt;dw = Nothing&lt;BR /&gt;ds = Nothing&lt;BR /&gt;excel = Nothing&lt;BR /&gt;sheet = Nothing&lt;BR /&gt;source = Nothing&lt;BR /&gt;&lt;BR /&gt;End Try&lt;BR /&gt;&lt;BR /&gt;If I defined the value specifically it works fine e.g. workbook.ActiveChart.FullSeriesCollection(1).XValues = "=Sheet1!$A$2:$B$2"&lt;BR /&gt;&lt;BR /&gt;But obviously I would want to pass the range value as a parameter to make it dynamic. I know I'm missing something obvious here but I just cant put my finger on it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Technical lead developer&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2020 15:24:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50943#M6094</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2020-09-10T15:24:00Z</dc:date>
    </item>
    <item>
      <title>RE: Amending excel graph data ranges</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50944#M6095</link>
      <description>Hi &lt;SPAN&gt;Michael,&lt;BR /&gt;&lt;BR /&gt;Can you share the error message that you are getting?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Shashank Kumar&lt;BR /&gt;DX Integrations Partner Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;Singapore&lt;BR /&gt;+6581326707&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Sep 2020 07:06:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50944#M6095</guid>
      <dc:creator>shashank.kumar280</dc:creator>
      <dc:date>2020-09-11T07:06:00Z</dc:date>
    </item>
    <item>
      <title>RE: Amending excel graph data ranges</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50945#M6096</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;The error I get is:&lt;BR /&gt;Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))&lt;BR /&gt;&lt;BR /&gt;I think this is related to the horizontal reference of the range so something in&amp;nbsp;workbook.Sheets(Source_Worksheet).Range(Source_Range) but I'm not sure what part of this its not accepting.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Senior Developer&lt;BR /&gt;Clydesdale and Yorkshire bank&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Sep 2020 15:12:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50945#M6096</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2020-09-11T15:12:00Z</dc:date>
    </item>
    <item>
      <title>RE: Amending excel graph data ranges</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50946#M6097</link>
      <description>For anyone who was reading this and looking to do the same thing with charts I finally got it resolved. The below code works and you can also use the same code to update the chart series by adding the following, please note the series position is dynamic number value since I want to loop through every series to update them.&lt;BR /&gt;&lt;BR /&gt;workbook.ActiveChart.FullSeriesCollection(Series_Position).Name = ("=" &amp;amp; Source_Worksheet &amp;amp; "!" &amp;amp; Source_Range)&lt;BR /&gt;workbook.ActiveChart.FullSeriesCollection(Series_Position).Values = ("=" &amp;amp; Source_Worksheet &amp;amp; "!" &amp;amp; Source_Range)&lt;BR /&gt;&lt;BR /&gt;Full code&lt;BR /&gt;---------------------------------------------------------------&lt;BR /&gt;Dim sw, dw As Object&lt;BR /&gt;Dim ss, ds As Object&lt;BR /&gt;'Dim activeCell AS Object&lt;BR /&gt;Dim excel, sheet, source, workbook As Object&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;sw = GetWorkbook(CInt(Handle), Source_Workbook)&lt;BR /&gt;ss = GetWorksheet(CInt(Handle), Source_Workbook, Source_Worksheet)&lt;BR /&gt;sw.Activate()&lt;BR /&gt;ss.Activate()&lt;BR /&gt;excel = ss.Application&lt;BR /&gt;sheet = excel.ActiveSheet&lt;BR /&gt;workbook = excel.ActiveWorkbook&lt;BR /&gt;sheet.ChartObjects(Chart_Name).Activate()&lt;BR /&gt;workbook.ActiveChart.FullSeriesCollection(1).XValues = ("=" &amp;amp; Source_Worksheet &amp;amp; "!" &amp;amp; Source_Range)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Success = True&lt;BR /&gt;Message = Chart_Name &amp;amp; " successfully updated"&lt;BR /&gt;&lt;BR /&gt;Catch e As Exception&lt;BR /&gt;Success = False&lt;BR /&gt;Message = e.Message&lt;BR /&gt;Finally&lt;BR /&gt;sw = Nothing&lt;BR /&gt;ss = Nothing&lt;BR /&gt;dw = Nothing&lt;BR /&gt;ds = Nothing&lt;BR /&gt;excel = Nothing&lt;BR /&gt;sheet = Nothing&lt;BR /&gt;source = Nothing&lt;BR /&gt;&lt;BR /&gt;End Try&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Technical Lead developer&lt;BR /&gt;Everis Consultancy&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Sep 2020 13:20:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Amending-excel-graph-data-ranges/m-p/50946#M6097</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2020-09-17T13:20:00Z</dc:date>
    </item>
  </channel>
</rss>

