Not founding worksheet method in invoke code activity

Dim objWorkbook As microsoft.Office.Interop.Excel.Workbook

objWorkbook = objXLS.CurrentWorkbook

For Each ws As Worksheet In objWorkbook.Sheets
For Each sh As microsoft.Office.Interop.Excel.Shape In ws.Shapes
sh.Delete
Next sh
Next ws

Using this code in invoke activity…but all the time getting compiler error…

sharing screenshots

Hello @Omkar_Deshmukh

for this to work you will need to install “Microsoft.Office.Interop.Excel” package

It is already there in my packages

Main.xaml (5.4 KB)
give a try with xaml

Not getting the exact issue…when i click on edit code the error comes up…the same error…have all the required packages still getting error.

Hi @Omkar_Deshmukh :wave:

The workflow uploaded by @AkshaySandhu works for me. Did you also install the Microsoft.Office.Interop.Excel package before running the process?

What’s the exact error that you’re getting?