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?