Status Update
Comments
se...@google.com <se...@google.com>
se...@google.com <se...@google.com> #2
Hello,
How about using the method
This would be like this:
function myFunction() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const a1 = ss.getRange("Sheet1!A1");
const a2 = ss.getRange("Sheet1!A2");
a1.setValue('=IMAGE("https://i.imgur.com/dcAoUzp.jpg")');
a1.copyTo(a2);
}
Regards.
j....@oxf.gdst.net <j....@oxf.gdst.net> #3
My use case is getting an array of data from one spreadsheet, filtering and modifying it, and then writing the modified array to a different spreadsheet. It would be good if CellImages could be passed around just like other spreadsheet values. It definitely shouldn’t produce an error if I read an array of values from one spreadsheet, and then write to another – just because one of the values is a CellImage.
I will see if I can use copyTo as a workaround. Perhaps I could add array coordinates as additional properties of the CellImage objects, then do some additional filtering before writing.
se...@google.com <se...@google.com> #4
Hello,
Were you able to use the copyTo
for your use case?
Regards.
j....@oxf.gdst.net <j....@oxf.gdst.net> #5
No, I get the following error:
Exception: Target range and source range must be on the same spreadsheet.
se...@google.com <se...@google.com> #6
Can you share a copy of your spreadsheet with the code to reproduce it as you have it?
Regards.
se...@google.com <se...@google.com> #7
Hello,
This is being closed due to inactivity.
If you are still experiencing this behavior, please open a new one and provide all the details there. Feel free to reference this one.
Regards.
Description
A short description of the issue:
When getting values from a spreadsheet, a value can be a CellImage. But setting this value to a different cell on the spreadsheet generates an error.
What steps will reproduce the problem?
Call this function:
What is the expected output? What do you see instead? If you see error messages, please provide them.
The image in A1 should be copied to A2. Instead, the function generates the following error:
## Please provide any additional information below.
A workaround would be to convert the CellImage to a blob and re-build it. However, CellImage has no methods to do this.