Re: scale
Re: scale
- Subject: Re: scale
- From: Julien Battist <email@hidden>
- Date: Mon, 20 Feb 2017 20:04:30 +0100
- Importance: normal
- Sensitivity: Normal
Hi Andrew,
Let me reformulate my question....
I am placing a picture in excel ....
set imageWidth to 150
set imageHeight to 150 --- this should not be 150 but the same % scale factor of imageWidth which I don't know how to handle
tell application id "com.microsoft.Excel"
activate
set newPic to make new picture at beginning of active sheet of active workbook with properties {file name:"PathTofile", left position:15.0, top:15.0, height:imageHeight, width:imageWidth, placement:placement move}
end tell
So 150 is the fixed width size for every picture I want to place. The image height needs to be corrected to a proportional size. So if 150 width = to scale factor 33% of the picture then I need to adapt the scale factor for the height also to 33%.
Much appriciate for any feedback, Julien
Sent: Monday, February 20, 2017 at 6:14 PM
From: "Andrew Oliver" <email@hidden>
To: "Julien Battist" <email@hidden>
Cc: email@hidden
Subject: Re: scale
There is no ‘scale’ property of a picture's ‘height’. Excel’s dictionary states that ‘height’ is a
real, and therefore has no further properties.
Why not just do something like:
tell application id "com.microsoft.Excel"
tell active sheet of active workbook
tell picture 1
set lock aspect ratio to false
set h to get height
set height to h * 1.5
end tell
end tell
end tell
(you need to unlock the aspect ratio in order to scale width and height independently)
Andrew
:)
On Feb 20, 2017, at 3:34 AM, Julien Battist <
email@hidden> wrote:
Hi all,
It seems to be impossible to get the scale factor of a place picture in Excel 2011.
I am able to place an image but I need to make it proportional. So width size is fixed, height size need to be proportional adapted.
Any help is much appreciated.
tell application id "com.microsoft.Excel"
tell active sheet of active workbook
tell picture 1
get height
--- 150.0
get scale of height
--- missing value
end tell
end tell
end tell
Many thanks,Julien
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives:
http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >scale (From: Julien Battist <email@hidden>) |
| >Re: scale (From: Andrew Oliver <email@hidden>) |