使用VBA在EXCEL中插入图片自定义函数(网络URL/本地URL)
来源:互联网 发布:天策军爷捏脸数据 编辑:程序博客网 时间:2024/05/21 11:37
Sub InsertPic(ByVal 图片链接 As String, ByVal 插入图片表名 As String, ByVal 插入图片单元格地址 As String) On Error Resume Next Dim rng As Range Set rng = Sheets(插入图片表名).Range(插入图片单元格地址) With Sheets(插入图片表名).Pictures.Insert(图片链接) .ShapeRange.LockAspectRatio = msoFalse '取消锁定比例 .Width = rng.Width - 3 .Height = rng.Height - 3 .Top = rng.Top + 1.5 .Left = rng.Left + 1.5 If Err.Number <> 0 Then .Delete Err.Clear End If End With Set rng = NothingEnd SubSub InsertPic2(ByVal 图片链接 As String, ByVal 插入图片表名 As String, ByVal 插入图片单元格地址 As String) On Error Resume Next Dim rng As Range Set rng = Sheets(插入图片表名).Range(插入图片单元格地址) With Sheets(插入图片表名).Shapes.AddShape(msoShapeRectangle, rng.Left + 1.5, rng.Top + 1.5, rng.Width - 3, rng.Height - 3).Select '插入一个矩形框 Selection.ShapeRange.Fill.UserPicture 图片链接 '给框内填充图片 Selection.ShapeRange.Line.Visible = msoFalse '无边框 If Err.Number <> 0 Then Selection.Delete Err.Clear End If End With Set rng = NothingEnd SubSub 调用() Call InsertPic("http://www.baidu.com/img/bd_logo1.png", ActiveSheet.Name, "c1")End Sub
阅读全文
0 0
- 使用VBA在EXCEL中插入图片自定义函数(网络URL/本地URL)
- Java使用URL读取网络图片资源 并保存在本地
- 通过自定义URL协议在Web中启动本地应用程序
- 通过自定义URL协议在Web中启动本地应用程序
- 自定义URL协议在Web中启动本地应用程序
- 通过自定义URL协议在Web中启动本地应用程序
- 通过自定义URL协议在Web中启动本地应用程序
- 使用URL下载网络图片
- 使用POI在EXCEL中插入图片
- 使用对象URL实现本地预览图片
- Excel自定义函数VBA
- 获取图片URL和创建自定义函数
- 在Excel 中用VBA插入图片的方法
- 在Excel中插入图片
- 在VBA中引用excel的函数
- web预览本地图片(对象URL)
- Android 使用URL读取网络图片
- Android 使用URL显示网络图片
- java简单实现双色球彩票模拟实例(数组、排序、方法、随机数、键盘输入)
- linux学习
- Selenium Firefox 官方Webdriver -- Geckodriver
- oracle 数据误删除 数据恢复
- 帝国cms仿站:基于PHP实战帝国CMS系统二次开发
- 使用VBA在EXCEL中插入图片自定义函数(网络URL/本地URL)
- Linux中Nginx安装与配置详解
- 我的博客地址
- Mac上解决node sudo启动80端口,提示ADDRINUSE 的错误
- 解决:Python-aiohttp.ClientPayloadError:Response payload is not completed
- Linux CENTOS6.* 安装rabbitMQ
- 关于U盘安装CentOS 7(CentOS-7-x86_64-DVD-1708.iso)的流程以及安装过程中的一些问题
- 服务器后台运行的优势和方法
- 网络编程(一)