vba 如何为vba-excel表格制作exe
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19050756/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to make exe for vba-excel form
提问by Viral
is there any way to create exe or something like that for my userform made in excel vba.
有什么方法可以为我在 excel vba 中制作的用户表单创建 exe 或类似的东西。
i tried to open it everytime the workbook gets open but once i exit the form,i get back to the sheet1(where the data entered by user is getting dumped) and then the data entry person gets confused on how to get the form back.instead of it i want to have some way to hide the sheet from the user or simply want to give them the userform to enter the data.
每次工作簿打开时,我都尝试打开它,但是一旦我退出表单,我就会回到工作表 1(用户输入的数据被转储),然后数据输入人员对如何取回表单感到困惑。而不是它,我想有一些方法来隐藏用户的工作表,或者只是想给他们用户表单来输入数据。
any mechanism to open the form with any shortcuts?
任何使用任何快捷方式打开表单的机制?
采纳答案by Siddharth Rout
Yup!
是的!
Use Application.visible = False
and then reset it. Put this in your userform
使用Application.visible = False
然后重置它。把它放在你的用户表单中
Private Sub UserForm_Initialize()
Application.Visible = False
End Sub
'
'~~> Rest of the code
'
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
ThisWorkbook.Close SaveChanges:=True '<~~ Save workbook before closing
DoEvents
Application.Visible = True
End Sub