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…
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.
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?
Your cell range is protected, use VBA to remove the Data Validation ,Password is not required. Sub RemoveDataValidations_ActiveSheet() Cells.Validation.Delete End Sub
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
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
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()