Copy sheets to a new workbook and rename the

How can I use workbook1 as the parent and copy all other workbooks that have 1 sheet into workbook1 without it reading that it needs to also copy workbook1 into workbook1 which throws an error? (I tried using the Input file to grab the file names however the file name for workbook1 is also listed in this so it throws an error.)

file directory:
* workbook1 (has 2 sheets)
* workbook2 (has 1 sheet to copy)
* workbook3 (has 1 sheet to copy)
* workbook4 (has 1 sheet to copy)

1 Like

Hey @Laura2

Did you try this activity?

Thanks
#nK

Yes I am trying to use this activity however i have one file that has 2 sheets that i need copied. im not sure how i can do that.

1 Like

Hey @Laura2

You can use the above activity two times, if that is fixed.

Else you can first do Get Sheets and then use a loop to iterate and perform Copy again for n number of sheets.

Hope that helps.

Thanks
#nK

thanks i will try that, one more question: how do you use this without it creating a new workbook? if you want to copy sheet to an existing workbook at another file location? So right now it will copy the sheet as well as pastes it into the correct folder, however it creates a new file with the same name instead of pasting it in the existing one.

I added the destination file path: Path
file sheet: rawdata
input sheetname: rawdata

the result is 2 files one with the intended file and one with the RawData sheet

1 Like

@Laura2 For me its copying the sheet in existing file. Are you using studio or StudioX

@Laura2 Are you giving the exact destination file path. Make sure it does not includes any additional spaces

Im using Studio.

1 Like

Im using a dynamic selector since the file location will be in the folder for today’s date. there is a space so i think you are correct.

1 Like

@Laura2 Make sure it does not contains any space. Also, do a simple test. Instead of passing dynamic path just give the static actual path of the file. Check it is doing same thing (creating new file) here as well. If that’s not the case that means the path that you are passing dynamically contains some spaces hence it is creating new file everytime

1 Like

Hey @Laura2

As per the activity docs, Copy Sheet will copy sheet in the same source sheet of there is no destination provided.

Thanks
#nK

1 Like

That worked. Thank you guys so much!

1 Like

Cool @Laura2 :+1::innocent:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.