excel 我可以在PowerAutomate中从电子表格中的按钮运行流而不使用VBA吗

pod7payv  于 2023-06-07  发布在  其他
关注(0)|答案(2)|浏览(323)

我对Power Automate非常陌生,所以我可能会以完全错误的方式进行。
目前我使用的是'当文件被创建或修改触发器'。但我需要更多的手动操作。用户需要能够双重检查信息,然后手动关闭流程。
最好是个纽扣。但我了解到的是,有问题的流不适用于.xlsm文件,所以我已经使用Power Query将数据从file1.xlsm移动到file2.xlsx,然后Power Automate能够从file2.xlsx选择数据。作为一个自动化的过程,这是工作正常。我可以使用file1.xlsm中的宏打开file2.xlsx,刷新查询,然后流将自动触发。
但是现在我需要能够手动打开file2.xlsx,仔细检查数据,并在启动流之前根据需要进行更改。
我曾经尝试过使用一个按钮以某种方式更改单元格中的值(类似于复选框,但它似乎不是一个带有按钮的选项),然后将其用作power automate的触发器(尽管我不确定这是否可能)。
我想我应该在这里问一下,是否有人知道任何我没有想到的非常明显的选择。我觉得这应该是一个相当标准的excel /自动化功能,我错过了一些明显的东西。

kjthegm6

kjthegm61#

是的,您可以从电子表格中的按钮运行Power Automate中的流,而无需使用VBA。Power Automate提供了多种触发流的方法,包括与Microsoft Excel的集成。以下是实现此目标的方法:

Create a flow in Power Automate:
    Go to the Power Automate website (https://flow.microsoft.com/) and sign in with your Microsoft account.
    Click on "My flows" in the top navigation bar and then select "Create" to create a new flow.
    Choose the desired trigger for your flow. For example, you can select "When a new row is added, modified, or deleted" if you want to trigger the flow when changes are made to a specific Excel spreadsheet.
    Configure the trigger based on your requirements, such as selecting the Excel file and specifying the worksheet.
    Add the actions and logic you want to perform in your flow. For example, you might want to send an email, update another system, or perform data operations.

Publish the flow as a button:
    Once you've built the flow, click on the "..." (ellipsis) button next to the flow name and select "Add a button" from the dropdown menu.
    Choose the button design and customize its label if needed.
    Save the flow.

Add the button to your spreadsheet:
    Open the Excel spreadsheet where you want to add the button.
    Select the "Insert" tab from the Excel ribbon.
    Click on "Office Add-ins" (or "Get Add-ins" depending on your Excel version) and search for "Power Automate" in the add-in store.
    Install the "Power Automate" add-in.
    After installation, you should see a "Power Automate" button in the Excel ribbon.
    Click on the "Power Automate" button, sign in with your Microsoft account if prompted, and select the flow you created.

Associate the button with the desired spreadsheet action:
    With the Power Automate add-in open, select the button and click on the "..." (ellipsis) button in the add-in pane.
    Choose the action you want to associate with the button, such as "Run flow" or "Custom action."
    Configure any additional parameters or inputs required for the action.
    Save the changes.

现在,当您打开电子表格时,您将看到Power Automate加载项添加的按钮。单击该按钮将触发Power Automate中的关联流,执行流中定义的操作和逻辑。
此方法允许您直接从Excel界面触发流,而无需VBA代码。

kuarbcqp

kuarbcqp2#

有几种方法可以解决这个问题。你最终会走的路完全取决于你。

Office脚本

https://learn.microsoft.com/en-us/office/dev/scripts/overview/excel
在这个框架中,您可以添加一个按钮,然后执行一个特定的功能,该功能可以执行您想要的操作并在字段中设置一个值。

您需要检查相关的范围值,以确定是否继续执行PA流,然后将该字段设置回另一个值,该值将为用户群的每一个其他后续更改关闭触发器。
这是最好的选择吗可能没有,但你问了,所以我想给予你一些可能的见解。

PowerAutomate按钮

与其使用修改后的文件触发器,为什么不创建一个通过按钮(Manually trigger a flow操作)触发的流呢?

这允许对流动的运行进行完全控制。该按钮只能分配给您自己,因此只有您能够运行它。如果你想把它分配给其他人,你也可以这样做。
底线是,这将是你的按钮推。你不会从Excel中做,你只是从PA中做。它也可以很容易地从移动的应用程序访问。
对我来说,这将是更明显的方法。

相关问题