Excel Office Scripts: Calculate, create Chart, get Chart & Table image, Email

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024

Комментарии • 15

  • @kamalam29
    @kamalam29 3 года назад +1

    Hi Sudhi, Thank you for such a nice demonstration of automating tasks through office scripts and power automation.

  • @ekinbasha7081
    @ekinbasha7081 Год назад

    Hi Sudhi, very useful video, Thanks, I exactly followed your steps and got the results.
    Is it possible to add multiple charts and multiple tables of the same sheet. Please recommend some ideas to the query.

  • @don3482
    @don3482 3 года назад +1

    Hi Sudhi. Is there a way to get images of multiple tables in worksheet and email each image to different individuals?

  • @MrSalFav
    @MrSalFav Год назад

    Really useful and good video. Thank you !

  • @tonyhart2371
    @tonyhart2371 2 года назад

    Hi Sudhi. I am curious as to why your script in the video here does not match the script in the online article I found. Everything is the same with the exception of the function updateRange. The script does not have that function. There are some lines as part of the first function that say it is adding the selected data to the new worksheet. Has something changed since you first recorded this whereas the function is no longer needed to add the data?

  • @balabaskarchalumuri
    @balabaskarchalumuri 3 года назад

    Video was really helpful, can we pass that table range to my email body in power automate flow, instead of sending it as image ?

  • @SantiagoDavel
    @SantiagoDavel 2 года назад

    Hi Sudhi, for some users, the images do not show in the outlook email but instead show a red X. Do you know what could be the issue? Many thanks in advance!

  • @anahy8900
    @anahy8900 2 года назад

    Hi! Thanks for the video! What would my code look like if I just pinned an image from my spreadsheet to a range? For example (A2:C4)

  • @NZsolt91
    @NZsolt91 2 года назад

    Hi. I did it step by step, but the email what i got does not contain any pictures. Can you help me to solve this problem?

  • @davecotr
    @davecotr 3 года назад

    thank you your video was very interesting. What part of the code should I use to export just the chart?

    • @s65012r
      @s65012r  3 года назад

      If you don't need the table, just remove all references to the table and just keep the chart part in the source -
      github.com/sumurthy/officescripts-projects/blob/main/Chart%20and%20Table%20Images/ReportImages.ts
      If you already have a chart and don't need to create it, then just use the get APIs to get the chart and then get its image (rather than creating it new).
      // Get chart 1 from Sheet1.
      const chart_1 = workbook.getWorksheet('Sheet1').getChart('Chart 1');
      const chartImage = chart_1.getImage();
      LMK if you need more help.

    • @davecotr
      @davecotr 3 года назад

      @@s65012r tnx for the reply but it doesn' t work. I also tried to change const with a variables but without results. Do you have any tips?

    • @s65012r
      @s65012r  3 года назад

      @@davecotr I don't know the scenario to give you the exact script.
      If you have the chart all ready to go (you don't need to create it), then the following script will work. You can use the chartImage property in the email just like I show in the video.
      If you need to add a chart to begin with, then use the addChart() API shown in my video and then get the chart image.
      SCRIPT:
      function main(workbook: ExcelScript.Workbook): ReportImages {
      const chartSheet = workbook.getWorksheet('ChartSheet');
      // Insert chart on sheet 'Sheet1'
      const chart = chartSheet.getCharts()[0]; //It gets the first chart
      // const chart = chartSheet.getCharts('Chart 1'); // if you know the name
      const chartImage = chart.getImage();
      return {
      chartImage
      }
      }
      interface ReportImages {
      chartImage: string
      }

    • @georgeerasmus7051
      @georgeerasmus7051 3 года назад

      @@s65012r I can not thank you enough, this has been incredibly helpful!

    • @hanahana6308
      @hanahana6308 2 года назад

      @@s65012r I have 2 charts in my excel sheet and when I used the given script I get an error while testing the flow. And the error is "Cannot read property 'getImage'. Any advice on this?