Constant values
defined by MS Office Objects:
For
example, in OpenExcelFromExcel.htm (in Week 3) when using
the Office File Dialog to open a file you need the constant: msoFileDialogOpen.
In that example, it is called as a method of xlAppl.Application:
dlgOpen = xlAppl.Application.FileDialog(msoFileDialogOpen);
JScript does not have the msoFileDialogOpen symbol
predefined. Here is how we can find out the value of this constant and then set
it in your script
1.
FileDialog
is a shared Office dialog, but that may not be obvious from the script. Follow it in the literature as an Excel
method. Using the Excel Object Model:
2.
Click
on the Application object of Excel():
3.
Click
on the Application Members and find FileDialog in the properties list.
4.
Click
on FileDialog:
a.
It
is called with a parameter fileDialogType
b.
Click
on the MsoFileDialog Type link given there
5.
Four
values of the parameter are given, and the desired constant msoFileDialogOpen has the value 1.
6.
Define
this constant in your J-Script code:
var msoFileDialogOpen = 1;
7.
Alternatively,
you could directly to
the Office Object Model Reference for Office 2010 and click on
"Enumerations" and find msoFileDialogType
there. Even though you are invoking FileDialog
from within Excel, you cannot find this constant under Excel Object Model Enumerations,
beause this is a general Office constant (mso...) and not one specific
to Excel (xL...).
.