I understand that a premium license is required to enable automatic flow initiation for PAD.
Does anyone have ideas on how to create a similar workflow with the following actions for free?
・ The flow should activate every Wednesday.
・ Take a screenshot from a specific site.
・ Place the screenshot in a specific Excel file at the following cells:
First in A1, then in D1, and thirdly in H1.
Additionally, I would like to know how to create a workflow that performs these tasks without the initial action.
Hey - as everybody else states here, this is a premium license action, so you would unfortunately need to cough up some money to get this sorted. For the request you need to get sorted, I just uploaded a video on my channel on how to handle that as I have to do a similar thing (take progress screenshots of KPIs from a dashboard - but the point is the same). It's a fairly easy operation. I normally set a variable to cover the date of the day its running, and then it's just launching a browser, going to a website, using the take screenshot action and saving it in a file using the variable as a prefix to save the file in yyyyMMdd_name arrangement. I'll link my profile below in case you need video to support.
Hi @Korokd !
I can give you a flow using PAD but to do automatic flow runs definitely requires a premium license.
But I did see some info somewhere but haven't tried it out. Here are some links:
Run Flow From Command Prompt or Windows Task Scheduler | Power Automate Gallery
(given by @VJR )
YouTube links:
How to schedule in Power Automate Desktop WITHOUT Power Automate Cloud or Premium license)
One STEP hack to schedule in Power Automate Desktop WITHOUT Power Automate Cloud or Premium license)
The full flow:
I have used Python and PowerShell to accomplish this.
Make sure to have this installed into your system using cmd (Administrator):
pip install pyautogui openpyxl
Python script (save it as script.py in some folder):
import pyautogui
import openpyxl
from openpyxl.drawing.image import Image
from openpyxl.utils import get_column_letter
import time
from datetime import datetime
import os
# Function to take a screenshot
def take_screenshot(filename):
screenshot = pyautogui.screenshot()
screenshot.save(filename)
# Function to resize and insert image into Excel
def insert_resized_image_into_excel(image_path, excel_path, cell, width=None, height=None):
if not os.path.exists(excel_path):
# Create a new workbook if the file does not exist
wb = openpyxl.Workbook()
wb.save(excel_path)
else:
# Load existing workbook
wb = openpyxl.load_workbook(excel_path)
ws = wb.active
img = Image(image_path)
# Resize image if width or height is provided
if width and height:
img.width = width
img.height = height
ws.add_image(img, cell)
# Adjust column width to fit the resized image
column_letter = cell[0]
ws.column_dimensions[column_letter].width = img.width / 7 # Adjust as needed
wb.save(excel_path)
# Get the current date and format it
current_date = datetime.now().strftime('%A_%b_%d_%Y')
# Create the filenames
image_filename = f"C:/Users/Nathan/Desktop/TestingSaveScreenshotToExcel/screenshot_{current_date}.png"
excel_filename = f"ExcelFile_{current_date}.xlsx"
excel_path = f"C:/Users/Nathan/Desktop/TestingSaveScreenshotToExcel/{excel_filename}"
# Take screenshot
take_screenshot(image_filename)
# Insert resized image into Excel at specified cell and adjust column width
insert_resized_image_into_excel(image_filename, excel_path, 'A1', width=300, height=200) # Adjust width and height as needed
insert_resized_image_into_excel(image_filename, excel_path, 'D1', width=300, height=200) # Adjust width and height as needed
insert_resized_image_into_excel(image_filename, excel_path, 'H1', width=300, height=200) # Adjust width and height as needed
# Optional: Add delay to ensure the tasks are performed sequentially
time.sleep(5)
PowerShell script (have to put this in PAD using the Pre-built action):
# Run the Python script
Start-Process -FilePath '%pythonPath%' -ArgumentList '%scriptPath%' -NoNewWindow -Wait
Output:-
Before:
After:
Image:
Excel file:
And to run this every Wednesday, you would need premium using the Windows Task Scheduler. More info here in the link on how to set it up:
https://www.youtube.com/watch?v=pFZSajbQsxc by the infamous, Anders Jensen.
Code (just copy paste into your flow):
SET pythonPath TO $'''C:\\Python312\\python.exe'''
SET scriptPath TO $'''C:\\Users\\Nathan\\Desktop\\TestingSaveScreenshotToExcel\\script.py'''
WebAutomation.LaunchChrome.LaunchChrome Url: $'''https://www.activision.com/?utm_source=404&utm_medium=redirect&utm_campaign=122222''' WindowState: WebAutomation.BrowserWindowState.Maximized ClearCache: False ClearCookies: False WaitForPageToLoadTimeout: 60 Timeout: 60 PiPUserDataFolderMode: WebAutomation.PiPUserDataFolderModeEnum.AutomaticProfile BrowserInstance=> Browser
@@copilotGeneratedAction: 'False'
Scripting.RunPowershellScript.RunPowershellScript Script: $'''# Run the Python script
Start-Process -FilePath \'%pythonPath%\' -ArgumentList \'%scriptPath%\' -NoNewWindow -Wait''' ScriptOutput=> PowershellOutput ScriptError=> ScriptError
WebAutomation.CloseWebBrowser BrowserInstance: Browser
I hope this helps.
Hi @Korokd ,
Unfortunately, triggering PAD Workflows automatically on a specific schedule (like every Wednesday) requires a premium license.
To create your flow in PAD. I have created a sample but you need to change it according to your requirement.
Here are the steps:
1.Take a screenshot from a specific site:
Add a Launch new Chrome action and enter the URL of the site you want to take a screenshot from.
Add a Web page screenshot action. This will take a screenshot of the currently active web page in Chrome.
2.Save the screenshot:
Add a Save image action and specify the file path where you want to save the screenshot.
3.Open the Excel file and insert the screenshot:
Add an Excel Launch and attach action and specify the path of your Excel file.
Add an Excel Set cell picture action and specify the cell (A1, D1, or H1) and the file path of the screenshot.
Repeat steps 3-5 for each cell you want to insert a screenshot into.
4.Close the Excel file and the browser:
Add an Excel Close action to close the Excel file.
Add a Close web browser action to close the browser.
(Note:- if you got your solution you can mark as solution and gives kudos)
Thanks & Regards
Vishnu Reddy
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,089
Most Valuable Professional