<?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 Uisng the Run Macro action in the Excel VBO to run a macro on a different worksheet in another workbook in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Uisng-the-Run-Macro-action-in-the-Excel-VBO-to-run-a-macro-on-a/m-p/56454#M10631</link>
    <description>Morning,

I've seen a couple of other similar posts but nothing that asks this question specifically.

How do I run a macro via BP on a worksheet in a workbook that doesn't contain the macro.

If I was using Excel and from within Workbook X, Worksheet Y hit Alt F8 and brought up the macro dialogue I could select to view macros in all open workbooks.  I could then select a macro that resided in Workbook A and run it but the code would be executed upon the worksheet from where I brought up the dialogue, Worksheet X in Workbook Y.

There's a post further down that talks about adding extra code to the Run Macro action, some parameters are added.  I've done that and the code validates, so I have something like this.  See attached file, Untitled.jpg

So my question is; is this correct, you will see that despite adding the extra parameters they are not displayed when I add the object via an action.

Am I doing this correctly or completely incorrectly.

Cheers,

Phil.</description>
    <pubDate>Mon, 26 Jun 2017 16:55:00 GMT</pubDate>
    <dc:creator>PhilElliott</dc:creator>
    <dc:date>2017-06-26T16:55:00Z</dc:date>
    <item>
      <title>Uisng the Run Macro action in the Excel VBO to run a macro on a different worksheet in another workbook</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Uisng-the-Run-Macro-action-in-the-Excel-VBO-to-run-a-macro-on-a/m-p/56454#M10631</link>
      <description>Morning,

I've seen a couple of other similar posts but nothing that asks this question specifically.

How do I run a macro via BP on a worksheet in a workbook that doesn't contain the macro.

If I was using Excel and from within Workbook X, Worksheet Y hit Alt F8 and brought up the macro dialogue I could select to view macros in all open workbooks.  I could then select a macro that resided in Workbook A and run it but the code would be executed upon the worksheet from where I brought up the dialogue, Worksheet X in Workbook Y.

There's a post further down that talks about adding extra code to the Run Macro action, some parameters are added.  I've done that and the code validates, so I have something like this.  See attached file, Untitled.jpg

So my question is; is this correct, you will see that despite adding the extra parameters they are not displayed when I add the object via an action.

Am I doing this correctly or completely incorrectly.

Cheers,

Phil.</description>
      <pubDate>Mon, 26 Jun 2017 16:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Uisng-the-Run-Macro-action-in-the-Excel-VBO-to-run-a-macro-on-a/m-p/56454#M10631</guid>
      <dc:creator>PhilElliott</dc:creator>
      <dc:date>2017-06-26T16:55:00Z</dc:date>
    </item>
    <item>
      <title>I have never tried what ask,</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Uisng-the-Run-Macro-action-in-the-Excel-VBO-to-run-a-macro-on-a/m-p/56455#M10632</link>
      <description>I have never tried what ask, but there is a Run Macro action in the MS Excel VBO.  For a macro held in a different open workbook can you not put the full reference to the other workbook in.  So rather than just passing the macro name as the input parameter try something like 'My Document.doc'!ThisModule.ThisProcedure
If that does not work then you will need to create your own action that does what you need like previous posts suggest.  The starting point for me would be googling the excel run command for more details.</description>
      <pubDate>Mon, 26 Jun 2017 18:07:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Uisng-the-Run-Macro-action-in-the-Excel-VBO-to-run-a-macro-on-a/m-p/56455#M10632</guid>
      <dc:creator>Denis__Dennehy</dc:creator>
      <dc:date>2017-06-26T18:07:00Z</dc:date>
    </item>
    <item>
      <title>Hey Phil,</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Uisng-the-Run-Macro-action-in-the-Excel-VBO-to-run-a-macro-on-a/m-p/56456#M10633</link>
      <description>Hey Phil,
We faced a similar issue concerning private procedures and i can at least confirm, that calls like 
'private procedure on specified sheet
Instance.Run(Instance.Sheets(wks_name).CodeName+"".""+MacroName)
'procedure on specified workbook
Instance.Run(""'""+WorkbookName+""'!""+MacroName)
do work, so in theory, the suggested way by Denis should work out as well :)
What I ended up doing was creating (admittedly messy) try nests, that listen for any COMException, to sort of preserve the simplicity of just calling one Action with a given procedure Name without having to worry about the actual implementation in the workbook much.
Hope it helps!
BR
MaKrale</description>
      <pubDate>Tue, 04 Jul 2017 22:57:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Uisng-the-Run-Macro-action-in-the-Excel-VBO-to-run-a-macro-on-a/m-p/56456#M10633</guid>
      <dc:creator>MarkusKrahn</dc:creator>
      <dc:date>2017-07-04T22:57:00Z</dc:date>
    </item>
  </channel>
</rss>

