脱机图片超链接

我想使用vba从excel表格中脱离图片,但无法find解决scheme。

find下面的链接,但它是形状和图表,不能与链接插入的图片工作: –

http://answers.microsoft.com/en-us/office/forum/office_2010-word/convert-linked-excel-charts-to-embedded-ones/357bb64d-b852-4e43-8671-b0f49f0dabc3

图像仍然是一个形状。 分享你的代码,也许你错过了一个错误。 如果这是一个带有HyperLink的简单图像,那么试试这个

ActiveSheet.Shapes.Range(Array("Picture 1")).ShapeRange.Item(1).Hyperlink.Delete 

否则,请执行以下操作 – 转到“开发人员”选项卡并单击“录制macros” 接下来从图像中手动删除超链接,然后再次点击loggingmacros。 然后转到VBA项目并查看生成的代码以删除超链接。

这里有4种不同的方式可能工作,没有一个是完美的,所以尝试在debugging模式

 err.clear on error resume next 'everything not working will throw an Error with activesheet.shapes("Picture 1") .type=13 'forcfully changing the type form a linketype to normal picture, might not work .linkformat.autoupdate = false 'might not work .hyperlink = false 'might not work .formula = VbNullString 'might not work 'if all fails try the last hope (copy it but no link) .copy 'if fails : ActiveSheet.Pictures.Paste link:=True 'activesheet.Pictures.Paste link:=True 'failed (works only for picture copy of ranges ?) ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)" 'you can save .top and .left in a single variable and replace the new pic on the right place Dim X as single, Y as Single X=.left Y=.top with activesheet.shapes(activesheet.shapes.count) 'the new pic is the last in shapes collection 'same result but i like it less, with : selection.shaperange.item(1) ' you need to be in the picture's sheet, wich in our case is ok because we work on activesheet .top=Y .left=X .name = "Picture 1" End with .delete 'removes the old picture End With