Error in DialogSheets

T

tapanmishra

Hi

I am using one of the dialogueSheet function. i am getting subscript
out of range in the first line . can anyone suggest anything. help is
appreciated.

Dim DBoxOk As Boolean
Dim DBox As DialogSheet

Sub InitMainMenu()
' Set object variables
Set DBox = DialogSheets("bomenu")
Set monthlist = DBox.DropDowns("month_list")
Set yearlist = DBox.DropDowns("year_list")
Set rucoa = DBox.CheckBoxes("ru_coa")
Set rustate = DBox.CheckBoxes("ru_state")
Set rubas = DBox.CheckBoxes("ru_bas")

what does "bomenu" means . can it be any word or it is some
pre-requisite.


thanks
tapan
 
H

Harald Staff

Hi Tapan

bomenu is simply the name of the dialog sheet used in the original code, the name on its
sheet tab. Rename your dialog, or replace bomenu with the real dialog name, or simply put
its index number there (which is 1 if you have only one dialog):

Set DBox = DialogSheets(1)

The rest of the things in quotes are also names, so rename them either in the code or in
the dialog, ot use their index numbers like above. Ulike userforms, dialog controls are
members of spesific collections, so numbers are fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top