Update Excel Chart and select two ranges

In Excel, if I want to update the data range, I can use the dialog box to enter (or select) the ranges. I want the header row and the last row of data. The range has a comma between the two ranges: =Sheet1!$K$1:$O$1,Sheet1!$K$24:$O$24

Can I do that in Update Chart in UiPath? What can I put in the data range?

I know my last row is

Excel2.Sheet(“Sheet1”).Range(“K”+LastRowEkoPerformanceReportData.ToString + “:O”+LastRowEkoPerformanceReportData.ToString)

And this works fine. I just need to know how to include the header range (K$1:$O$1).

Hi @cgoldstein , Were you able to solve this in the end?

Yes, I believe I had to use a string variable and create the two ranges in the variable, and then it worked as I was hoping it would.

Hi @cgoldstein ,

Thanks for replying. Could you please let me know how can I form the string when I have 3 headers and 3 data ranges with an example?

I had two ranges, so hopefully it works for 3.
I used an assign before the Update Chart activity.

ChartRange = “$K$1:$O$1,K”+LastRowEkoPerformanceReportData.ToString + “:O”+LastRowEkoPerformanceReportData.ToString

That has the first range, followed by a comma, then the second range. ChartRagne is a string.

Hi @cgoldstein ,

Thanks for the above reply. Can you please let me know how can I update the chart when the header range and data range is present in another excel file?

Thanks

Hi,

You may need to reference the two different Excel files, like Excel and Excel2. I’m not doing that in my case since I only am working with one Excel file.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.