Hi Folks,
How to delete the specific workbook sheet in excel in UiPath?
The Sheet name is “Sheet1”.
Thanks in advance.
Regards,
Sharu
Hi Folks,
How to delete the specific workbook sheet in excel in UiPath?
The Sheet name is “Sheet1”.
Thanks in advance.
Regards,
Sharu
Hi @sharu_priya ,
Use Delete sheet activity.
https://docs.uipath.com/activities/other/latest/user-guide/delete-sheet-x
Yeah i saw this.
But i do not have this activity in m studio.
Which package needs to be installed for this?
Regards,
Sharu
Delete Sheet Activity is not Showing in modern also
UiPath.Excel.Activities
Its already there
Hi @sharu_priya
Please try to this macro:
Sub DeleteSheet()
Dim sheetName As String
sheetName = "Sheet1"
Application.DisplayAlerts = False
Worksheets(sheetName).Delete
Application.DisplayAlerts = True
End Sub
Hope this helps,
Best Regards
Hi @sharu_priya ,
You can use excel VBA as well to delete the sheet:
Inside the excel application scope, insert the invoke vba.
Sub vba_delete_sheet()
Sheets(“SheetName”).Delete
End Sub
Regards,
Yes, it is enabled
Thank you so much.will Try now
Hi @sharu_priya
To delete a specific worksheet named “Sheet1” in UiPath, you can follow these steps:
Sub DeleteSheet()
Application.DisplayAlerts = False
ThisWorkbook.Sheets(“Sheet1”).Delete
Application.DisplayAlerts = True
End Sub
@sharu_priya
Write the vba code in a file and provide that file location in a vba source code file path.
Set the “vba source code file path” property to the full path of the Excel workbook that contains the macro code i shared above
it Worked.
Thank you so much.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.