我正在使用VBA将数据从Excel文件导入Visio,并且还需要在Visio文件中包含一个不在我的Excel文件中但保存在本地的图像。我需要能够像处理形状对象一样操纵图像(即,使用VBA设置其宽度/高度/位置,例如Shape.Cells(“宽度” = X等))
我已经在网上广泛地寻找解决方案,但无济于事。
您必须定义要在其中插入图片的页面。进一步了解Page.Import Method (Visio)
Set shp = ActivePage.Import("C:\Users\surrogate\Pictures\new.png")
shp.Cells("PinX").Formula = "100 mm"
shp.Cells("PinY").Formula = "150 mm"