【问题标题】:picture.insert with hyperlink图片.插入超链接
【发布时间】:2019-11-15 20:23:25
【问题描述】:

我有一个自动生成的图片链接。现在我尝试让一个按钮将实际图像插入到 excel 中,但似乎没有任何效果。

当我使用类似的替代方案 - ActiveSheet.Pictures.Insert 时,调试器会突出显示带有错误代码 4xx 或 1xxx 的“ActiveSheet”部分。 谷歌目前没有解决方案。

Sub Insert_Picture()

  Dim url
  Dim pic As String 'file path of pic
  Dim myPicture As Picture 'embedded pic

  url = Range("Tabelle1!A1").Value
  pic = "url"

  Set myPicture = ActiveSheet.Pictures.Insert(pic)

End Sub

【问题讨论】:

    标签: excel vba image hyperlink insert


    【解决方案1】:
    pic = "url"
    Set myPicture = ActiveSheet.Pictures.Insert(pic)
    

    相信你会发现"url"不是一个有效的URL。您的意思是改为写pic = url

    (您也可以在尝试插入之前使用Dir检查文件是否存在)

    【讨论】:

      猜你喜欢
      • 2012-04-11
      • 2015-07-13
      • 2010-10-09
      • 2011-05-10
      • 2011-09-22
      • 2017-08-07
      • 2018-05-23
      • 2017-05-03
      • 2011-10-15
      相关资源
      最近更新 更多