用加载宏向工作表中添加logo
时间:2011-08-09
来源:互联网
想写个加载宏,其中有个功能需要将本地的一个logo图片保存在加载宏中,然后使用该功能,就可以把logo加入到工作表的指定位置。
因为工作环境不能上网,所以必须把图片保存在宏中,不知道能否实现,感谢先。
因为工作环境不能上网,所以必须把图片保存在宏中,不知道能否实现,感谢先。
作者: hbpaopao 发布时间: 2011-08-09
请上传相关附件,不然没办法下手
作者: xtanuihazfh 发布时间: 2011-08-09
在网出差,网络太烂,附件上传不了……
兄弟可以随便找张图片就好,只要能实现以下功能就好,给个大概的样子,剩下的我可以自己摸索。
图片是保存在加载宏文件中的,然后借用了别人的代码,打开后在excel菜单栏新加了一栏。
[copy]
Sub auto_open()
Call addbutton
End Sub
Sub addbutton()
Dim ctlEdit As CommandBarPopup
Dim ctlRegEx As CommandBarButton
With Application.CommandBars("Worksheet Menu Bar").Controls.Add(Type:=msoControlPopup, Before:=11)
.Caption = "DIY"
End With
Set ctlEdit = Application.CommandBars(1).Controls("DIY")
Set ctlRegEx = ctlEdit.Controls.Add(msoControlButton)
With ctlRegEx
.Caption = "加logo"
.OnAction = "logo"
.BeginGroup = True
.Visible = True
.Enabled = True
End With
End Sub
sub logo()
end sub
[/copy]
现在的要求就是在sub logo()中加一段代码,然后我以后使用此功能的时候,他可以在当前工作表把logo图片加进入,不用老是自己去找。
兄弟可以随便找张图片就好,只要能实现以下功能就好,给个大概的样子,剩下的我可以自己摸索。
图片是保存在加载宏文件中的,然后借用了别人的代码,打开后在excel菜单栏新加了一栏。
[copy]
Sub auto_open()
Call addbutton
End Sub
Sub addbutton()
Dim ctlEdit As CommandBarPopup
Dim ctlRegEx As CommandBarButton
With Application.CommandBars("Worksheet Menu Bar").Controls.Add(Type:=msoControlPopup, Before:=11)
.Caption = "DIY"
End With
Set ctlEdit = Application.CommandBars(1).Controls("DIY")
Set ctlRegEx = ctlEdit.Controls.Add(msoControlButton)
With ctlRegEx
.Caption = "加logo"
.OnAction = "logo"
.BeginGroup = True
.Visible = True
.Enabled = True
End With
End Sub
sub logo()
end sub
[/copy]
现在的要求就是在sub logo()中加一段代码,然后我以后使用此功能的时候,他可以在当前工作表把logo图片加进入,不用老是自己去找。
作者: hbpaopao 发布时间: 2011-08-09
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28