*Resolved* Welcome Message (dialog box) for Excel
I am writing an Excel app. which I intend to try and sell and so for each person/company that buys it I need a customised dialog box (userform) which will contain their details to show that they have the license for that copy.
E.g. on loading the app. in Excel a dialog box opens which states:
----------------------------------------------
My App v1.0
This copy is licensed to Bob Smith of Smith Co.
---------------------------------------------
I've tried a few things but can't get this to work. I would have thought it should be easy but no luck so far.
I don't even know which module I need to put the code in to make it run when the application opens! Anyone got any ideas?
Cheers
-Rob
Re: Welcome Message (dialog box) for Excel
Is your app written all in an Add-In or VB automation exe?
Also, is it required to have Macros enabled?
This will work if Macros are enabled and its not in an Add-In. Add-In code
would be similar.
VB Code:
'Inside 'ThisWorkbook' Object
Private Sub Workbook_Open()
UserForm1.Show vbModal
End Sub
'Behind Forms Objects
Private Sub UserForm_Initialize()
Label1.Caption = "Version xx.x" & vbNewLine & "Licensed to RobDog888"
CommandButton1.Caption = "Ok"
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Re: Welcome Message (dialog box) for Excel
It's just a standard Excel application, not an Add-In (I wouldn't know how to make an Add-In anyway).
It needs to have macros enabled as there is a lot of VBA code in the application, a lot of macros and a lot of userforms.
Also:
Code:
UserForm1.Show vbModal
What does this line do? I've not seen the vbModal command before and I can't find it in the VBA help file.
Cheers
-Rob
Re: Welcome Message (dialog box) for Excel
Its under FormShowConstants in the Object Browser (F2). What it does it exactly
what the VB version does, stops code execution until the form is dismissed.
Re: Welcome Message (dialog box) for Excel
Ah, okay. Do I need it in the code though? I've just tried it without the vbModal part and it seems to work fine. :confused:
Re: Welcome Message (dialog box) for Excel
It would force the user to dismiss the form instead of potentially leaving the
form open during the entire users session.
;)