community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Community v19.6

Looks aren't everything... But the latest Community refresh looks darn good!

Learn More

Output data into a sheet in a read-only excel file and make a copy of that file

Asteroid

Hi everyone!

 

I'm trying to run a data cleaning workflow, then write the data in an excel file with a lot of pivot tables and formula. It's a read-only file so I'm trying to create a copy of it and output my data in one of the hidden sheets in that file. Is that possible?

I tried the method in this thread but the file created is also a read-only file so I cannot write my output in it.

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Automate-copy-and-paste-Excel-file-bef...

Bolide

Hello @LinhNguyen,

 

It would definitely be a batch command to do so. Essentially you could use a macro within the file to do a save as where read-only is false. I would need to look up the VBA code that does it. You could even use the Events tab in Alteryx to run the command before your workflow so it would do this before any of the files. If it is like the attached need and you need to create a new file based on what is the most recent file, the Events command may not be the best idea, but just a simple copy/save/remove read-only this should work.

Asteroid

Hi @cplewis90,

 

Thanks for the suggestion! I just need to make a copy of a template and append a new sheet in it.

 

The problem is that the template file is a read-only file and it has macros and pivot tables. I don't know how to turn off the read-only mode so I'm testing on another template file now but whenever I try to write anything in, it corrupts.

 

If you have any batch command that can make copy and remove read-only, please let me know.

 

Thank you!!!

Bolide

Hey @LinhNguyen,

 

I don't have a template where I have needed to do this and all my run command templates have proprietary information in them so I cannot share them at this time. I did find a sample of some script that may be helpful to you in creating the .vbscript file or .bat file at the following link:

https://stackoverflow.com/questions/35358158/vbs-script-remove-read-only-and-add-read-only

Asteroid

@cplewis90 I have tried but still haven't figured out how to use that vbscript code to turn off read only in a file.

 

Could you give me an example workflow please?

 

Thank you!

Bolide

I don't have an example I can share as most of my workflows have proprietary information that cannot be shared. Have you seen this link for more in depth information:

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/The-Run-Command-Write-Source-amp-Read-Result...

Labels