Constant values defined by MS Office Objects


Constant for MS Excel Dialog to open a file is:

            xlDialogOpen


VBScript does not understand the identifier "xlDialogOpen". Here is how we can find out the value of this constant.


Which class does xlDialogOpen belongs to?

Before we even begin, we need to find which "class" defines the "xlDialogOpen" constant. This can be done by

 

1.    Start the "Microsoft Excel Visual Basic Reference" help page.

 

2.    Click on the "Search" tab.

 

3.    Type in "xlDialogOpen" as the word to search.

 

4.    From the selected topics, we see that "xlDialogOpen" belongs to the "XlBuildInDialog" class.

 

Remember this information, and now we are ready to find out the value for "XlBuildInDialog.xlDialogOpen" .

 

What is the value of XlBuildInDialog.xlDialogOpen?

1.    Start MS Excel (if we need to find a constant defined in MS Excel, we can start MS Word instead)

 

2.    In Excel:

Tools->Macro->Visual Basic Editor

 

3.    In Visual Basic Editor: 

Tools->References

 

scroll to "Microsoft Word ##.# Object Library" (where ##.# are numbers, e.g., 11.0) and make sure this object library is checked.

 

Click ok.

 

4.    Still in Visual Basic Editor:

 

View->Object Browser

 

a.    On the left column select the _class_ name XlBuildInDialog

 

b.    On the right column, scroll to find/select xlDialogOpen, and now look at the status area, we see that

 

Const xlDialogOpen = 1

 

This says the value of the constant is 1.