Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Changing File Name without changing formatting

Kanika29
6 - Meteoroid

Hi,

 

I have created a workflow to overwrite a range of cell in excel, now i want to save that output file by renaming (file name not sheet name) it without loosing excel formattingCapture.PNG. How can i do this?

5 REPLIES 5
messi007
15 - Aurora
15 - Aurora

@Kanika29,

 

You can use Blob tools to take a copy of the created file and past it to a new name.

It will keep formatting:

 

messi007_0-1631533747771.png

 

Hope this helps,

Regards

Kanika29
6 - Meteoroid

Hi 

patrick_mcauliffe
14 - Magnetar
14 - Magnetar

Hey @Kanika29 

 

If I'm following what you're asking for correctly, you want to write out a sheet of new data that has a format matching an existing sheet.

Yes?

If that's the case:   The cool thing about Excel files is they aren't some unique, specific file which can only be read one way.

They're a cleverly disguised zip file.

Seriously, try changing the file extension of .xlsx to .zip and open it up.

There's a wide array of contents they could have but at the very least you'll find a few xml files.  These are the independent properties of the "Excel file".  There may be others depending on what your Excel contains (images, merged cell references, etc).

How is this relevant to keeping your formatting while changing the data?

You can "simply" remove the stylesheets that define the cell level format from within one Excel file and place it in another.

If you want to get fancy and complex you can also update the stylesheet programmatically, but you're going to have to do a bit of research before going that far.

(see open office standards docs  openoffice.org/xml/general.html )

 

But what if you don't want to manually change the file path (or use 7zip) to transfer between archives/xlsx?

You can write some command like arguments to run in Alteryx that will do this for you.

 

I've attached a starter workflow with macros and sample Excel files that should be helpful to your quest.

 

 

Kanika29
6 - Meteoroid

thanks patrick

patrick_mcauliffe
14 - Magnetar
14 - Magnetar

Hey @Kanika29  let us know if this answered your question by accepting as a solution.  This helps everyone looking for similar solutions on the community.

Labels
Top Solution Authors