Cloud Computing Insider Awards 2022: Vote for ONLYOFFICE
Vote for ONLYOFFICE

Coping data between two files

Hi, I have read your instructions ONLYOFFICE Api Documentation - How it works concerning exchanging data among files and try to use it for coping data between two files. Below the code:

builder.OpenFile(“C:\File1.xlsx”);
var oWorksheet = Api.GetSheet(“Sheet1”);
var Rng= oWorksheet.GetUsedRange()
GlobalVariable[“CR”]= Rng
builder.CloseFile();

builder.OpenFile("C:\File2.xlsx ");
var oWorksheet = Api.GetSheet(“Sheet1”);
var Rng = GlobalVariable[“CR”]
Rng.Copy(oWorksheet.GetRange(“A3”))
builder.SaveFile(“xlsx”, "C:\File2.xlsx ");
builder.CloseFile();

And I’ve got the following messages about errors:

Uncaught TypeError: Converting circular structure to JSON

Uncaught TypeError: Cannot read property ‘Copy’ of undefined

As I understand, the problem is in the “GlobalVariable”. Could you advise me what’s wrong with using of GlobalVariable?

Hello @los_al
We are checking the situation, I will update this thread when we have something to share.

We have checked the situation and we found known issue. We are planning to fix it in the next version of Document server.
The situation is related to method for creating objects based on their description in json format. We are working on it.

When are you going to issue the next version of the Document server?

The mentioned feature will be included in Document Server v.7.3. We are planning to release it on December, 2022.