Error in Sharepoint Write Wrange: Invalid argument

I am trying to copy the data from excel file on sharepoint to and trying to write in other excel file.
Write Wrange: Code: InvalidArgument
Message: The argument is invalid or missing or has an incorrect format.
Inner error:
Code: invalidArgument
Message: The argument is invalid or missing or has an incorrect format.
AdditionalData:
date: 2023-05-15T13:36:07
request-id: fe9a1f49-f228-4f0d-b00e-80fd82eefa83
client-request-id: fe9a1f49-f228-4f0d-b00e-80fd82eefa83
ClientRequestId: fe9a1f49-f228-4f0d-b00e-80fd82eefa83
Data I am reading :
image

Here I want to Write :

@PALKUMARI_PATEL

Can you please show how you are trying and what properties you have used

Looks like the range is wrong or it might be because of the filters as well if it is coming on write range

Cheers

1 Like

So, I tried with providing range and it gives me error . Then I tried to read without providing range as I need entire file to be read so IT is working and re-writing into other spreadsheet.

Thanks though for the inputs.

1 Like

Got another error on Write rangeon different file :
Write Range: Code: tooManyRetries
Message: More than 3 retries encountered while sending the request.

If you can help here it would be great.

@PALKUMARI_PATEL

did you use retry on top of it?

can you show what you are doing and how its configured?

cheers

I am not using any of the retry , I am just deleting data from the sheet . Reading data from other sheet and try to Write the read data into this Deleted data space.

Using : O365 scope and used find files and folder to get particular file.

@PALKUMARI_PATEL

Can you show what you gave in range what properties have been used and all…from the current error does not give more info on what is going wrong

cheers

Here is the Write Range , Changed the names of file and sheet.
image

@PALKUMARI_PATEL

Are you pasting with headers?

Are there any filters in the file?

If yes then paste the data without headers and from B2

Cheers

Yes, I am pasting with Headers. I tried with no headers but still same error coming. No other filters are there. Can you help to figure out ?

@PALKUMARI_PATEL

With no headers you used B2 as start cell?

When error occurs please open exception details from locas panel can check exact exception there

Cheers

I tried that too. Same error again.It is printing the data when I checked but giving error too. I don’t know why?

From Local Panel :
RemoteException wrapping Microsoft.Graph.ServiceException: Code: tooManyRetries
Message: More than 3 retries encountered while sending the request.

at Microsoft.Graph.RetryHandler.d__10.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.RetryHandler.d__9.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.CompressionHandler.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.AuthenticationHandler.d__16.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.d__58.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.SimpleHttpProvider.d__13.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.SimpleHttpProvider.d__10.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.d__40.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.d__34`1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.Excel.Extensions.ExcelExtensions.d__15.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.Activities.Excel.WriteRange.d__22.MoveNext()
— End of stack trace from previous location where exception was thrown —
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

@PALKUMARI_PATEL

Looks like the request is getting timeeput and its retrying automatically…

Can you try with smaller data or on a different file to check if the issue persists please

Cheers

Sure, will try and check.

Hi @Anil_G Read and write working with other workbook and also working same data when I use normal code without O365 and sharepoint link.

It works when I used mapped network drive location to point the same file and sheet for Copy and Paste Data.

Don’t understand why it is not working. FYI- There is around 2000 rows.

@PALKUMARI_PATEL

Is the file size close to 4mb? Because there is a limit for graph api upload which the office 365 activities use

When you mean normal code the normal excel activities …if ao there would be no relation between both …one is local and other is over network

Mapped drive may be working because of the same file size limits…there it uses local again

Cheers

Size is
image

It is printing the data also but don’t know why retrying by itself and throws error.

Is there any VBA Code to copy and paste the range on sharepoint ? Can you help me on this please it’s urgent.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.