hi community,
I am finding a way to move the worksheets from one workbook to another one.
I found a vba coding but i am not allowed to use vba
therefore could share some coding for me?
Thanks.
hi community,
I am finding a way to move the worksheets from one workbook to another one.
I found a vba coding but i am not allowed to use vba
therefore could share some coding for me?
Thanks.
Use Read Range activity to read it from one excel file and it will give output as DataTable. Let’s say ‘InputDT’.
And then use Write Range activity and pass inputDT to write into other excel file.
Hi,
We can achieve it using ClosedXML (used from Excel.Activities Package), as the following.
wbSrc = New ClosedXML.Excel.XLWorkbook("src.xlsx")
wbDist = New ClosedXML.Excel.XLWorkbook("dist.xlsx")
ws1 = wbSrc.Worksheet("Sheet1")
ws1.CopyTo(wbDist,"NewSheetName")
ws1.Delete()
wbDist.Save()
wbSrc.Save()
note: wbSrc and wbDist is XLWorkbook type. ws1 is IXLworkSheet type.
Regards,
as there are many formatting in the worksheet, therefore cant use read range?
Hey @raymondhui
Check this thread from stack overflow: C# - How to copy a single Excel worksheet from one workbook to another? - Stack Overflow
It’s the C# code but we can try to replicate the same in UiPath Invoke Code
Check if this helps you
yea finally i do more steps and use this activity.
Glad
Happy automation @raymondhui
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.