Setting Properties for a Shape in Excel

Hi I a new to scripting with applescript and was hoping someone could help me with setting the properties for a shape that I created?
I am trying to fill the shape with a picture and to make the shape a hyperlink to a web page.
I’ve tried to find an example of this, but so far I have not had a lot of luck.
When I try to fill the shape with a picture I get the error;
“Microsoft Excel got an error: The object you are trying to access does not exist”
If some one could show me an example of the proper format I would be very grateful.
Bellow is an example of the Script I am using to try to fill a shape with a picture.
Thank you

tell application "Microsoft Excel"
	make new shape at the beginning of worksheet 1 of workbook "Workbook1.xls" with properties {fill format picture "Macintosh HD:Users:mac39:Pictures:6.jpg"}
end tell

Model: iMac
Browser: Firefox 61.0
Operating System: Mac OS X (10.13 Public Beta)

This is working for me:


tell application "Microsoft Excel"
	set currentWorkbook to workbook 1
	tell currentWorkbook
		tell worksheet 1
			set pictureShape to make new shape at the beginning
			user picture pictureShape picture file "[put HFS path here]"
		end tell
	end tell
end tell

Forgot the hyperlink part of the question.

I’m having trouble with that. I tried setting a hyperlink for the picture shape manually through the GUI and confirmed it worked. But then when I use Applescript to retrieve the hyperlink property of the shape, the value is still “missing value.”

It won’t let me set the hyperlink value for the shape. In the Excel AS Dictionary, it says the access to the hyperlink property is “get,” not “get/set,” implying it can’t be modified via script.

But since that field isn’t even populating to Applescript for a working hyperlink, I’m not sure what’s going on… I may mess around with it more if I have time.

Warning, I’m on Excel 2008, some things may be different for my version.

I don’t know why it wasn’t returning the hyperlink information to my script at first. I tried again and it did start returning the hyperlink data for shapes once I had manually created a hyperlink for a shape.

But is still doesn’t appear to be writable via Applescript.

You could GUI script it.

Thanks Very much this was a great help! I will try scripting via the GUI and let you know
Thanks Again!