Approx a year ago, Excel add the function “Place in Cell” to allow images to be embedded into the cell. I cannot find any reference to that function in Excel Directory.
Im using Excel version 16.90.2
However, I have written a Script that places floating images above the relevant cells. These can then be embedded by selecting the image and clicking on the “Place in cell” pops-up box next to it. Is there anyway this can be done by using the keystroke technique?
get left position ofcell 3 ofrow 5 of active sheet of active workbook
→ 130.0
get top ofcell 3 ofrow 5 of active sheet of active workbook
→ 64.0
get width ofcell 3 ofrow 5 of active sheet of active workbook
→ 65.0
get height ofcell 3 ofrow 5 of active sheet of active workbook
→ 16.0
end tell
(130.0, 64.0)
tellapplication “Script Editor”
choose file
→ alias “MG_Archive:thumbnails:DSCF2113.JPG”
end tell
tellapplication “Microsoft Excel”
activate
make new picture at beginningof active sheet of active workbook with properties {file name:“/Volumes/MG_Archive/thumbnails/DSCF2113.JPG”, height:66.0, width:100.0, top:64.0, left position:130.0}
→ error number -1708
Result:
error “Microsoft Excel got an error: Can’t make class picture.” number -2710 from picture to class
The script will work if the particular picture has been imported before using Excel’s “Insert/Picture…” menu item.
If not done b4 → error
don’t know why !
This works but only places the image as a floating image on top, I want the image in the Cell…
set newPic tomake new picture at beginningofworksheet 1 ofworkbook 1 with properties {file name:POSIX file (item (idx) of thumbnailRefLinkList), height:targetImageHeight, width:targetImageWidth, top:theTop, left position:theLeft, placement:placement move}