VBA加载的宏,我在工具栏添加了菜单,请问如何制作成应用程序
VBA中,加载的宏,我在EXL工具栏添加了菜单,请问如何制作成应用程序,这样,我可以转发给其他人安装在exl中直接应用。...
VBA中,加载的宏,我在EXL工具栏添加了菜单,
请问如何制作成应用程序,这样,我可以转发给其他人安装在exl中直接应用。 展开
请问如何制作成应用程序,这样,我可以转发给其他人安装在exl中直接应用。 展开
3个回答
展开全部
再模块中添加auto_open事件代码
Sub auto_open()
Call addbutton
End Sub
Sub addbutton()
Dim popup As CommandBarPopup
Dim button As CommandBarButton
With Application.CommandBars("Worksheet Menu Bar").Controls.Add(Type:=msoControlPopup, Before:=11)
.Caption = "DIY"
End With
Set popup = Application.CommandBars(1).Controls("DIY")
Set button = popup.Controls.Add(msoControlButton)
With button
.Caption = "宏1"
.OnAction = "宏1名"
.BeginGroup = False
.Visible = False 'false 不可见
.Enabled = True 'false 按钮变灰
End With
End Sub
Sub auto_close()
Call DeleteToolbars
End Sub
Sub DeleteToolbars()
On Error Resume Next
Application.CommandBars(1).Controls("DIY").Delete
End Sub
然后另存成加载宏文件就好了。
展开全部
再模块中添加auto_open事件代码
Sub auto_open()
Call addbutton
End Sub
Sub addbutton()
Dim popup As CommandBarPopup
Dim button As CommandBarButton
With Application.CommandBars("Worksheet Menu Bar").Controls.Add(Type:=msoControlPopup, Before:=11)
.Caption = "DIY"
End With
Set popup = Application.CommandBars(1).Controls("DIY")
Set button = popup.Controls.Add(msoControlButton)
With button
.Caption = "宏1"
.OnAction = "宏1名"
.BeginGroup = False
.Visible = False 'false 不可见
.Enabled = True 'false 按钮变灰
End With
End Sub
Sub auto_close()
Call DeleteToolbars
End Sub
Sub DeleteToolbars()
On Error Resume Next
Application.CommandBars(1).Controls("DIY").Delete
End Sub然后另存成加载宏文件就好了。
Sub auto_open()
Call addbutton
End Sub
Sub addbutton()
Dim popup As CommandBarPopup
Dim button As CommandBarButton
With Application.CommandBars("Worksheet Menu Bar").Controls.Add(Type:=msoControlPopup, Before:=11)
.Caption = "DIY"
End With
Set popup = Application.CommandBars(1).Controls("DIY")
Set button = popup.Controls.Add(msoControlButton)
With button
.Caption = "宏1"
.OnAction = "宏1名"
.BeginGroup = False
.Visible = False 'false 不可见
.Enabled = True 'false 按钮变灰
End With
End Sub
Sub auto_close()
Call DeleteToolbars
End Sub
Sub DeleteToolbars()
On Error Resume Next
Application.CommandBars(1).Controls("DIY").Delete
End Sub然后另存成加载宏文件就好了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个不用做,只要保存为.docm,拷过去就可以了,当然对方要有EXCEL
更多追问追答
追问
你是说EXL保存为.docm,还是保存那个菜单栏?
追答
保存为.xla(刚刚口误说成WORD的了)。注意,别人的OFFICE也有VBA(安装了)才可以运行
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询