How will edit the protected .xlsm sheet without password

I had the protected .xlsm sheet…I want to edit the data in the sheet…But my problem is I
dont want to use the password for unlocking the sheet…Is it possible to edit the sheet without using password…Any activities are there in UIpath…

Thanks in advance…

@Nambi,

We are not able to open the file manually without giving the password right?
Then I hope we don’t have an option to do that in UiPath as well.

Try opening the file using

Process.Start(“file path and extension”)

No…I can open the file using excel application scope…It works…
But my problem is i need to edit the data…

it not works…

Is it opening the file without giving password?

the sheet is open…

As you are the one editing this file, try opening the file by providing the password and then try to edit. It will work @Nambi … Correct me if I’m wrong, you are opening the file without giving password I guess, so it is not allowing you to edit.

workbook is not protected…the sheet is protected

If workbook is protected the sheet will not open…In my case the sheet only protected…
is it possible to edit my sheet without unlocking the sheet

HI @Nambi

I don’t think you will get editable permission without giving the password to unlock the file. So why do you want to change it without unlocking it? Is it because you have forgotten the password or for some other reason?

I know the password…
But my usecase is i want to edit without using that password in that sheet

@Nambi

Your cell range is protected, use VBA to remove the Data Validation ,Password is not required.
Sub RemoveDataValidations_ActiveSheet()
Cells.Validation.Delete
End Sub

Hope this will help you.
Thanks
Suresh J

in VBA module option is disabled
it will asks the password.

VBA module also protected…

it will ask the password to enable the options…

Are you willing to remove the password of the sheet manually? @Nambi

Manually it is possible.There are many ways to remove the password Using tools or remove the protection code in xml file in the zip format…My usecase is it will be used in realtime…it will be a generic one…i want to implement in uipath

Sureshj information is good way to remove…But in my sheet VBA module will protected…
so that information is not possible for me…

i want suggestions like sureshj…

Yes , I understand @Nambi,

I mean, if you are willing to remove the password, then you can do the changes after removing the password. But, it is generic . So, it will have password everytime you get the file.

Can you try using the copy sheet activity to copy the sheet and then paste it with new sheet name and do the changes?

If you want to run the code to remove the validatiions to remove, I will send you the code , place it in Invoke code activity and run. Hope it will help :slight_smile:

    Dim excel As Microsoft.Office.Interop.Excel.Application
    Dim wb As Microsoft.Office.Interop.Excel.Workbook
    Dim ws As Microsoft.Office.Interop.Excel.Worksheet
   excel = New Microsoft.Office.Interop.Excel.Application
   wb = excel.Workbooks.Open(Entire file path, [ReadOnly]:=False) 
    excel.Visible = True
    ws = CType(wb.Sheets( sheet name), Microsoft.Office.Interop.Excel.Worksheet)
    ws.Activate()
  ws.Cells.Validation.Delete()
   wb.Save()
    wb.Close()
    excel.Quit()

I already tried it…It will not give solution for me…

Please try the above code @Nambi, Before using excel application scope using Invoke Code Activity which will open and clear the validations

Let me know the result :slight_smile: