Hi – I want to move one sheet from a excel file to another file. I use 2 excel application scope – One for read range and another for write range. It executes successfully, but i am not getting the same format from the original file. It is pasting as values and need the same format to the 2nd file. Can you help me on how to move the sheet to another?
@Subram As read range stores the data in Datatable, you cannot maintain the same format of the excel file. You follow below steps in order to delete a sheet from excel:
- Make a copy of the original file by copying the file to some path.
- Delete the sheet by using Ui-Automation on the excel.
– as you would already know the sheet name which needs to be deleted, use “Ctrl+g” hotkey on the excel file to go to the sheet.
– type “Sheetname!A1” in the “Go To” Window (which comes after you hit "Ctrl+g)
– Click on Home-> Delete->Delete Sheet. (Please find attached screenshot for this).
Thanks for your response But still i am not able understand . I already created a folder in a path and have 2 files in the folder. All i want is i want to move one particular sheet from file one and insert with same format in file two. Sorry if you have already answered this, but still if you can explain further it would be great
could you please send/attach an error that will be shown on console in read color?
Could not find member ‘CreateNewFile’ in type ‘http://schemas.uipath.com/workflow/activities:ExcelApplicationScope’. Row: 72, Column: 57
You want to move excel sheet from one sheet to another sheet or
one excel file file to another excel file
I want to move One sheet from Excel file A to another sheet In Excel file B
Please find the attachment of solution
Its easymove from one file to another file.xaml (7.4 KB)
Thanks – This is easy and i know this My question is i need the same format from the original sheet. but this query paste special values
I have attached the screen shot of the format. but while pasting the colour goes off
using copy file activity we can get that
chk it once
I got the file exactly with color
Copy file will copy the whole file, but i need to copy only the sheet.Eg total 3 sheets in a file and i need to copy only one sheet amd move to a difference excel file
May be a macro can solve the problem,such like :
Sub MacroCopySheet() Sheets([target sheet]).Select Sheets([target sheet]).Copy Before:=Workbooks([destination workbook]).Sheets(1) End Sub
You can try this,and let me know if it works.
you are experts but i am not!!! Please send me an excel file with a macro and i can edit the sheet name. plssssssssssssss
Please check the attachment file.
I upload one set of the sample:
1.the xaml (to use it you should rewrite the [excel.exe]'s and the excel files’s path)
2.the target excel
3.the destination excel
CopyExcelSheet.zip (20.2 KB)
Please try it.
What action u used in the below? its not appearing
Also tell me the macro name – i think you used execute macro