Is there a way for Alteryx to lock certain columns in excel output files so that they can't be edited? I'm not talking about locking the workflow, I mean the output files I have to produce need certain columns locked for editing upon output.
Solved! Go to Solution.
I believe you would need to have a VBA macro in the excel file that runs to lock the specific columns. Then you'd have to create a CMD .bat file that executes the VBA macro in excel. Alteryx can then link to that .bat with the Run Command tool. I don't know if the functionality exists within Alteryx to lock the columns without this.
You may consider creating an Excel Macro that protect the cells you want, this article may help you Triggering Excel Macros from the comfort of your Alteryx Workflow
I also found an article here in the community which I liked but I can find it now, from that article I downloaded the attached solution.
hth
Arnaldo
Hi @carterfleming ,
There one way to accomplish this.
It's a little involved but should work for you.
Start with a Template file that is already protected.
The use the Blob tools to make a bit for bit copy under a new name.
Run Workflow to update the new output file.
- Alteryx will update the field even if they are protected in Excel.
Example attached.
I use a macro I created called Blob_Copy:
Sample workflow attached.
Happy Solving
This looks like you're trying to read locked cells. That's the opposite of what I'm trying to do. I'm trying to take unlocked cells and lock them.
Overview General:
Solution Overview:
Notes:
Solution's Components:
Protect VBA code:
The MsgBox is commented out, if you keep it, the Alteryx workflow will hang in that message.
Run_Macro_Script.vbs:
-/-
I will resume/continue this reply on a second post, as this is very long.
hth
Arnaldo
This is the continuation of my reply, I got a weird message, and I do not want to lost a very long reply.
Warnings:
Remember this sample implemented the passwords: alteryx and a2.
hth
Arnaldo
I am attaching the workflow Protect_Excel_01.yxmd with its dependencies to this reply:
hth
Arnaldo