<?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 Re: How to delete picture in EXCEL workbook? in University Forum</title>
    <link>https://community.blueprism.com/t5/University-Forum/How-to-delete-picture-in-EXCEL-workbook/m-p/96774#M3210</link>
    <description>Hi&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In there isnt any functionality within blue prism that will do that for you currently so you would need to create new actions for this. If you know the name of the image you want to delete then you just need to add one action and create a code stage within it to delete the named image. If you dont know the name of the image then you might neeed to get a list of the image names and then loop these to delete the one you want to delete. I've provided code for the first action Delete image and the second code List images below. Hope this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Delete Image - Inputs are Handle, Source_Workbook, Source_Worksheet and Image_Name. The outputs are Success and Message&lt;BR /&gt;&lt;BR /&gt;Dim wb, ws As Object&lt;BR /&gt;Dim excel, sheet, image As Object&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;wb = GetWorkbook(Handle, Source_Workbook)&lt;BR /&gt;ws = GetWorksheet(Handle, Source_Workbook, Source_Worksheet)&lt;BR /&gt;&lt;BR /&gt;wb.Activate()&lt;BR /&gt;ws.Activate()&lt;BR /&gt;excel = ws.Application&lt;BR /&gt;sheet = excel.ActiveSheet&lt;BR /&gt;image = sheet.Shapes(Image_Name)&lt;BR /&gt;image.Select()&lt;BR /&gt;&lt;BR /&gt;image.Delete&lt;BR /&gt;&lt;BR /&gt;Success = True&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;wb = Nothing&lt;BR /&gt;ws = Nothing&lt;BR /&gt;excel = Nothing&lt;BR /&gt;sheet = Nothing&lt;BR /&gt;image = Nothing&lt;BR /&gt;End Try&lt;BR /&gt;---------------------------------&lt;BR /&gt;&lt;BR /&gt;List images - Inputs are Handle, Workbook and Worksheet. Outputs are as a collection called Images&lt;BR /&gt;---------------------------------------------------------&lt;BR /&gt;Dim wb, ws, excel, sheet As Object&lt;BR /&gt;&lt;BR /&gt;wb = GetWorkbook(Handle, Workbook)&lt;BR /&gt;ws = GetWorksheet(Handle, Workbook, Worksheet)&lt;BR /&gt;&lt;BR /&gt;wb.Activate()&lt;BR /&gt;ws.Activate()&lt;BR /&gt;&lt;BR /&gt;excel = ws.Application&lt;BR /&gt;sheet = excel.ActiveSheet&lt;BR /&gt;&lt;BR /&gt;Dim Table As New DataTable&lt;BR /&gt;Table.Columns.Add("Name", GetType(String))&lt;BR /&gt;&lt;BR /&gt;Dim image as Object&lt;BR /&gt;&lt;BR /&gt;For Each image In wb.Worksheets(Worksheet).Shapes&lt;BR /&gt;Table.Rows.Add(image.Name)&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;Images = Table&lt;BR /&gt;</description>
    <pubDate>Tue, 29 Nov 2022 14:26:52 GMT</pubDate>
    <dc:creator>michaeloneil</dc:creator>
    <dc:date>2022-11-29T14:26:52Z</dc:date>
    <item>
      <title>How to delete picture in EXCEL workbook?</title>
      <link>https://community.blueprism.com/t5/University-Forum/How-to-delete-picture-in-EXCEL-workbook/m-p/96773#M3209</link>
      <description>There are 2 pictures in my workbook and I want to delete 1 of them.&lt;BR /&gt;How can I use BluePrism to select the picture and delete it?&lt;BR /&gt;&lt;BR /&gt;regards!</description>
      <pubDate>Tue, 29 Nov 2022 12:18:51 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/How-to-delete-picture-in-EXCEL-workbook/m-p/96773#M3209</guid>
      <dc:creator>HWXie</dc:creator>
      <dc:date>2022-11-29T12:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete picture in EXCEL workbook?</title>
      <link>https://community.blueprism.com/t5/University-Forum/How-to-delete-picture-in-EXCEL-workbook/m-p/96774#M3210</link>
      <description>Hi&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In there isnt any functionality within blue prism that will do that for you currently so you would need to create new actions for this. If you know the name of the image you want to delete then you just need to add one action and create a code stage within it to delete the named image. If you dont know the name of the image then you might neeed to get a list of the image names and then loop these to delete the one you want to delete. I've provided code for the first action Delete image and the second code List images below. Hope this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Delete Image - Inputs are Handle, Source_Workbook, Source_Worksheet and Image_Name. The outputs are Success and Message&lt;BR /&gt;&lt;BR /&gt;Dim wb, ws As Object&lt;BR /&gt;Dim excel, sheet, image As Object&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;wb = GetWorkbook(Handle, Source_Workbook)&lt;BR /&gt;ws = GetWorksheet(Handle, Source_Workbook, Source_Worksheet)&lt;BR /&gt;&lt;BR /&gt;wb.Activate()&lt;BR /&gt;ws.Activate()&lt;BR /&gt;excel = ws.Application&lt;BR /&gt;sheet = excel.ActiveSheet&lt;BR /&gt;image = sheet.Shapes(Image_Name)&lt;BR /&gt;image.Select()&lt;BR /&gt;&lt;BR /&gt;image.Delete&lt;BR /&gt;&lt;BR /&gt;Success = True&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;wb = Nothing&lt;BR /&gt;ws = Nothing&lt;BR /&gt;excel = Nothing&lt;BR /&gt;sheet = Nothing&lt;BR /&gt;image = Nothing&lt;BR /&gt;End Try&lt;BR /&gt;---------------------------------&lt;BR /&gt;&lt;BR /&gt;List images - Inputs are Handle, Workbook and Worksheet. Outputs are as a collection called Images&lt;BR /&gt;---------------------------------------------------------&lt;BR /&gt;Dim wb, ws, excel, sheet As Object&lt;BR /&gt;&lt;BR /&gt;wb = GetWorkbook(Handle, Workbook)&lt;BR /&gt;ws = GetWorksheet(Handle, Workbook, Worksheet)&lt;BR /&gt;&lt;BR /&gt;wb.Activate()&lt;BR /&gt;ws.Activate()&lt;BR /&gt;&lt;BR /&gt;excel = ws.Application&lt;BR /&gt;sheet = excel.ActiveSheet&lt;BR /&gt;&lt;BR /&gt;Dim Table As New DataTable&lt;BR /&gt;Table.Columns.Add("Name", GetType(String))&lt;BR /&gt;&lt;BR /&gt;Dim image as Object&lt;BR /&gt;&lt;BR /&gt;For Each image In wb.Worksheets(Worksheet).Shapes&lt;BR /&gt;Table.Rows.Add(image.Name)&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;Images = Table&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Nov 2022 14:26:52 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/How-to-delete-picture-in-EXCEL-workbook/m-p/96774#M3210</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2022-11-29T14:26:52Z</dc:date>
    </item>
  </channel>
</rss>

