如何在 Excel 2010 中缩放 pictureLink 对象

发布于 2024-08-30 10:32:30 字数 366 浏览 4 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人│生佛魔见 2024-09-06 10:32:30

令人惊奇的是,在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文