One of the Excel Sheet types: dialog box

Source: Internet
Author: User

Iamlaosong

Once saw such a question:

There is an example of a VBA application that has such a code:
Thisworkbook.dialogsheets ("Start"). Show
I found the whole project did not see the "Start" this sheet, but the program can run and have a dialog box display, how can I find this dialog box?

Through research, found that the original dialogsheets here is actually the MS EXCEL 5.0 dialog Box , This object is not visible in the VBA integration Environment , but can be shown by show this method. This dialog box allows you to add controls and program them, so how many types of worksheets are involved?

XlSheetType can be one of the following XlSheetType constants.
Xlchart
Xldialogsheet
Xlexcel4intlmacrosheet
Xlexcel4macrosheet
Xlworksheet

After you select Insert, the Insert Sheet type selection appears after you right-click the sheet tab, see:


Corresponds to the following
Xlchart Chart
Xldialogsheet MS EXCEL 5.0 dialog box
Xlexcel4intlmacrosheet International Universal Macro Table
Xlexcel4macrosheet MS EXCEL 4.0 Macro table
xlworksheet Worksheet
If the Xlexcel4intlmacrosheet type is not present (see), after you perform the following procedure, the International macro table appears when you insert the sheet type.
Sub Insert1 ()
Sheets.add after:=sheets (sheets.count), Type:=xlexcel4intlmacrosheet
End Sub


After inserting a dialog box, you can edit it, add controls, assign a macro to the control, implement a function, and then right-click the Select Execution dialog box to test as shown in:


The following results are performed:


Here is an example of using a dialog sheet as a login interface:



' Login Window sub Login () with    Sheets ("Dlg_login")        . Editboxes.text = ""        . Labels.caption = ""    End with times    = 0    Sheets ("Dlg_login"). ShowEnd Sub

You can implement a password check by assigning a macro to the button.

Other discussions can also be found in the following links: Click to open Link


One of the Excel Sheet types: dialog box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.