Inserted Picture is referenced instead of inserted

2019-08-01 08:57发布

I use the following code to insert a logo into an excel chart:

ActiveChart.Pictures.Insert("path\logo.jpg").Select

I see the logo and everything is fine from my point of view. But if i send this file via e-mail to a collegue which doesn't have access to the path he cannot see the picture. From this evidence i conclude that the code references the picture instead of inserting it.

How does one insert a picture permanently, such that the logo will be visible even if the path is not accessible anymore?

1条回答
再贱就再见
2楼-- · 2019-08-01 09:17

To embed the image in the file you have to add a shape and then put the image in the shape using AddPicture

Application.ActiveSheet.Shapes.AddPicture "C:\documents\somepicture.jpg", False, True, 1, 1, 100, 100

This example comes from here

MSDN also has some information here

查看更多
登录 后发表回答