Excel VBA设置图像控件的图片属性 [英] Excel VBA Setting picture property of image control

查看:2348
本文介绍了Excel VBA设置图像控件的图片属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个excel工作簿.

我想将空的图像控件放置在Book A中的工作表上,并在运行时通过从以某种方式嵌入或存储在Book B中的图像中导入或获取图像信息中的图像信息来设置它们的图片属性,该图像信息将随本书一起发送出去答:

据我所能确定的,我只能使用loadPicture(path)来做到这一点,因为这没有图像的路径.我想解决引用并非所有人都需要的远程目录的需求.

有什么想法或者我怎么做?

谢谢

I have 2 excel workbooks.

I want to place empty image controls on sheets in Book A and set the picture property of them at run time by importing or getting the image information somehow from the images either embedded or stored in some fashion in book B which would be sent out with book A.

As far as i can determine, I can only do this with loadPicture(path) which is no good for this as there isn''t a path to the image. I want to get around the need to reference remote directories which not everyone will have acess to.

Any ideas if or how I can do this?

Thanks

推荐答案

使用剪贴板剪切和粘贴.就像工作簿A中的Set Picture1.picture = clipboard.getdata(ImageObj1)一样,将图片放置到剪贴板中,然后将其粘贴到工作簿B中.

从VBA编辑器的VBA帮助中搜索剪贴板".
Use cut and paste using the clipboard. It is something like Set Picture1.picture = clipboard.getdata(ImageObj1) from workbook A whiich places the picture into the clipboard, then paste it into workbook B.

Do a search for Clipboard in the VBA help from the VBA editor for the method.


这篇关于Excel VBA设置图像控件的图片属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆