简体   繁体   中英

how to make exe for vba-excel form

is there any way to create exe or something like that for my userform made in excel vba.

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.

any mechanism to open the form with any shortcuts?

Yup!

Use Application.visible = False and then reset it. Put this in your userform

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM