I would like to save an excel read-only file option to edit it.
Are there any better ways to do that other than keep clicking buttons?
Thank you!
I have a read only file
I want to convert that file to writable form
Yes it is locked and we have to edit it
I am getting this error
Hi @Kunal_Jain
Please find the solution in below
To do this in UiPath, you can use the Copy File activity and specify the source and destination paths for the copy of the file. Then, you can use the Write Range activity to edit the copied file, and the Save Workbook activity to save your changes.
Is there any script which we can use in invoke code.
Hi @Kunal_Jain
If you want an code means please check in below
Declare variables to hold the path of the read-only file and the new file name and path.
Dim readOnlyFilePath, newFilePath
Set the variables to the actual path of the read-only file and the new file name and path.
readOnlyFilePath = “C:\MyFiles\ReadOnly.xlsx”
newFilePath = “C:\MyFiles\Editable.xlsx”
Open the Excel application and the read-only file.
Set excelApp = CreateObject(“Excel.Application”)
Set workbook = excelApp.Workbooks.Open(readOnlyFilePath)
Save the file as a writable file using the SaveAs method.
workbook.SaveAs newFilePath
Close the Excel application and release the objects from memory.
workbook.Close
excelApp.Quit
Set excelApp = Nothing
Set workbook = Nothing
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.