Hi
I have a requirement where emails will have to be sent every hour of the day. This is based on an Excel in which a specific column will denote whether email for that particular row will have to be sent or not. This Excel will be constantly edited by one or multiple users. Alteryx cannot run the flow if an Excel that it is using is being edited.
I need to find a way to forcibly close that Excel sheet even if someone is working on it so that the next set of emails can be sent.
Any help is much appreciated.
Regards
Bobji
Hi @Kallis
I would use one of the bellow options:
1-Use this macro to copy the file(s) from the user location to another location. Then (using Block Until Done), attach the version of the "another" location to the email tool.
https://community.alteryx.com/t5/Community-Gallery/Copy-files-between-folders/ta-p/1174965
2-You can use the python component with a script to force closing the excel file. Something like this:
import pandas as pd
from openpyxl import load_workbook
for file_path in df['FullPath']:
# Load the Excel file
wb = load_workbook(file_path)
# Close the workbook
wb.close()
Thanks @Felipe_Ribeir0
One question. Will this Python script work if the Excel is kept open in another machine?
@Kallis You are right. 2 will not work because of the different machines. 1 will still work though.
@Kallis I do no think what you want is what you are asking for. You are asking for a situation where your boss - your bosses boss is editing this excel file - and suddenty it is force closed - and all the hard work is gone forever. Is that what you want? If it is - you have to look at killing an excel process - and having ownership of the file on the network drive - and sufficient permission to run powershell... If you have those - you can run:
close-SMBOpenFile -path via CLI in a powershell script (search for the forum on how to build one and pass in a variable of file location) that should close your file.
I would recommend -instead - keep this list in a database. Use Alteryx to retrieve data from a database.
Hello @apathetichell
Yes, that is exactly what I want. By the way, it will not be my boss who will edit this spreadsheet. Rather, it will be my peers. I will tell that team that when the time comes to run the next session, no matter what they have done with the spreadsheet, it will be closed through brute force.
Regards
Bobji
Thanks @Felipe_Ribeir0
Let me try this solution. It will take sometime because I need to talk to the business to get their acceptance.
