Delete a sheet in Excel

excel

#1

Hi All,

Hopefully this is a simple one and someone can give me a lead.

I’ve created and excel scope with a blank workbook, and written two datatables into two new sheets.

The workbook has the default “Sheet1” still, so I’d just like to delete it. I can’t see an excel activity for that, so have tried to do that just be including sending three hotkeys (Alt + h, d, s). which seems to delete the sheet.

However, then I close the scope, close the workbook and when I open it up to check, Sheet1 is back (and as blank as ever). Have included a quick screenshot of my Excel Application Scope.


#2

Solution was to just send a Ctrl + S hotkey for save while we were sending hotkeys anyway.

Easy solution when you think about, thanks for the lead @aksh1yadav


#3

Alt + h then d and then ctrl + S these 3 hotkeys will work in sequence and no need to pass enter key?


#4

hi,
YOU can try using invoke code activity
microsoft.office.interop.excel
provides delete method() to to remove a sheet from a workbook Main (2) (1).xaml (13.5 KB)


#5

Alt+h then d and then s and finaly ctrl+s,i think


#6

Hi,

Though I use Application.DisplayAlerts=False or Excel.DisplayAlerts=False, It is throwing a popup (Do you want to delete the sheet permanently). use this code instead

Regards,
Vikas Reddy