如何在 Excel 2010 中缩放 pictureLink 对象
在 Excel 2007 中,可以使用以下 VBA 代码缩放 pictureLink 对象(使用相机工具创建)。
With ActiveWorkbook.Sheets(sht).Pictures(name)
.ShapeRange.ScaleWidth scaleValue, msoTrue
.ShapeRange.ScaleHeight scaleValue, msoTrue
.top = top
.left = left
End With
此代码正确放置了 2010 年的图片,但忽略了scaleValue。 2010 Excel 文档关于此主题的内容并不完整。相同的代码在 Excel 2007 中运行良好。
In Excel 2007 it is possible to scale a pictureLink object (created with the Camera Tool) using the following VBA code.
With ActiveWorkbook.Sheets(sht).Pictures(name)
.ShapeRange.ScaleWidth scaleValue, msoTrue
.ShapeRange.ScaleHeight scaleValue, msoTrue
.top = top
.left = left
End With
This code places the picture correctly in 2010, but the scaleValue is ignored. The 2010 Excel documentation is patchy on this subject. The same code works fine in Excel 2007.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
令人惊奇的是,在 Excel 2010 中,将 ScaleValue 设置为 Excel 2007 中的 75% 就可以实现这一目的。因此,您需要为 Application.Version 创建 VBA 代码测试。
In Excel 2010, amazingly, setting the ScaleValue to 75% of what it is in Excel 2007, does the trick. So you would need to create VBA code testing for Application.Version.