Open a workbook.
Expression.Open(Filename,Updatelinks,Readonly,Format,Password,Writerespassword,Ignorereadonlyrecommended,Origin,Delimiter,Editable,Notify,Converter,Addtomru,Local,Corruptload)
ExpressionRequired. This expression returnsWorkbooksObject.
FilenameStringType, required. The name of the workbook to open.
UpdatelinksVariantType. Optional. Specifies the update method of the link in the file. If this parameter is omitted, the system prompts you to select the link update method. Otherwise, the value of this parameter should be a value in the following table.
Value |
Description |
0 |
No reference is updated. |
1 |
Update external references, but do not update remote references. |
2 |
Update remote references, but do not update external references. |
3 |
Update both remote reference and external reference. |
If Microsoft Excel is opening a file stored in wks, wk1, or wk3 format andUpdatelinksIf the parameter is 2, Microsoft Excel creates a chart based on the graph associated with the file. If this parameter is set to 0, no chart is created.
ReadonlyVariantType. Optional. If this value is true, the workbook is opened in read-only mode.
FormatVariantType. Optional. If Microsoft Excel is opening a text file, this parameter is used to specify the delimiter, as shown in the following table. If this parameter is omitted, the current Delimiter is used.
Value |
Delimiter |
1 |
Tab |
2 |
Comma |
3 |
Space |
4 |
Semicolon |
5 |
No Separator |
6 |
Custom characters (seeDelimiterParameters) |
PasswordVariantType. Optional. This string specifies the password to open a protected workbook. If this parameter is omitted and a password is set for the workbook, the user is prompted to enter the password.
WriterespasswordVariantType. Optional. This string is the write authorization password for a write protection workbook. If this parameter is omitted and a password is set for the workbook, the user is prompted to enter the password.
IgnorereadonlyrecommendedVariantType. Optional. If the value isTrue, Set Microsoft Excel to not display the recommended read-only message (if the workbook is saved with the "Recommended read-only" option ).
OriginVariantType. Optional. If the file is a text file, this parameter is used to indicate the operating system of the file (to correctly map the code page and press enter/line feed (CR/LF )). You canXlplatformConstant:Xlmacintosh,XlwindowsOrXlmsdos. If this parameter is omitted, the current operating system is used.
DelimiterVariantType. Optional. If the file is a text file andFormatIf this parameter is set to 6, this parameter is used to specify Characters Used as separators. For exampleChr(9)
"," Indicates a comma, and ";" indicates a semicolon or a custom character. If this parameter is a string, only the first character of the string is used.
EditableVariantType. Optional. If the file is Microsoft Excel 4.0, the value of this parameter isTrueYou can open the macro to see it in the window. If the value of this parameter isFalseIf this parameter is omitted, the loaded macro is opened in a hidden mode and cannot be set as visible. This option cannot be used to load macros created by Microsoft Excel 5.0 or later. If the file is an Excel template, the parameter value isTrueThe specified template is opened for editing. The parameter isFalseYou can open a new workbook according to the specified template. The default value isFalse.
NotifyVariantType. Optional. If the value of this parameter isTrueTo add the file to the file notification list. Microsoft Excel opens the file in read-only mode and polls the file notification list. It notifies you when the file in the file notification list is available. If the value of this parameter isFalseIf this parameter is omitted, no notification is requested and no unavailable files can be opened.
ConverterVariantType. Optional. The index number of the first file converter used to open the file. First, use the specified file converter: If the converter cannot recognize this file, try all the converters. Converter IndexFileconvertersThe converter line number returned by the property.
AddtomruVariantType. Optional. If the value isTrueTo add the workbook to the list of recently used files. The default value isFalse.
LocalVariantType. Optional. If the value isTrueTo save the file in Microsoft Excel (including the control panel settings. If the value isFalse(Mo
Save the file in the language of Visual Basic for Applications (VBA), where Visual Basic
Applications (VBA) is a typical American English version installed, unless the workbooks. open of the VBA project comes from the old international
Xl5/95 VBA project.
CorruptloadVariantType. Optional. Can be one of the following constants:Xlnormalload,XlrepairfileAndXlextractdata. If no value is specified, the default value is normal, but if Excel has tried to open the file, it can be in the secure loading or data recovery status. The preferred value is normal. If an Excel file is stopped when it is opened, it is in the safe loading status. If Excel stops again, the data is restored.
Open a workbook.
Expression.Open(Filename,Updatelinks,Readonly,Format,Password,Writerespassword,Ignorereadonlyrecommended,Origin,Delimiter,Editable,Notify,Converter,Addtomru,Local,Corruptload)
ExpressionRequired. This expression returnsWorkbooksObject.
FilenameStringType, required. The name of the workbook to open.
UpdatelinksVariantType. Optional. Specifies the update method of the link in the file. If this parameter is omitted, the system prompts you to select the link update method. Otherwise, the value of this parameter should be a value in the following table.
Value |
Description |
0 |
No reference is updated. |
1 |
Update external references, but do not update remote references. |
2 |
Update remote references, but do not update external references. |
3 |
Update both remote reference and external reference. |
If Microsoft Excel is opening a file stored in wks, wk1, or wk3 format andUpdatelinksIf the parameter is 2, Microsoft Excel creates a chart based on the graph associated with the file. If this parameter is set to 0, no chart is created.
ReadonlyVariantType. Optional. If this value is true, the workbook is opened in read-only mode.
FormatVariantType. Optional. If Microsoft Excel is opening a text file, this parameter is used to specify the delimiter, as shown in the following table. If this parameter is omitted, the current Delimiter is used.
Value |
Delimiter |
1 |
Tab |
2 |
Comma |
3 |
Space |
4 |
Semicolon |
5 |
No Separator |
6 |
Custom characters (seeDelimiterParameters) |
PasswordVariantType. Optional. This string specifies the password to open a protected workbook. If this parameter is omitted and a password is set for the workbook, the user is prompted to enter the password.
WriterespasswordVariantType. Optional. This string is the write authorization password for a write protection workbook. If this parameter is omitted and a password is set for the workbook, the user is prompted to enter the password.
IgnorereadonlyrecommendedVariantType. Optional. If the value isTrue, Set Microsoft Excel to not display the recommended read-only message (if the workbook is saved with the "Recommended read-only" option ).
OriginVariantType. Optional. If the file is a text file, this parameter is used to indicate the operating system of the file (to correctly map the code page and press enter/line feed (CR/LF )). You canXlplatformConstant:Xlmacintosh,XlwindowsOrXlmsdos. If this parameter is omitted, the current operating system is used.
DelimiterVariantType. Optional. If the file is a text file andFormatIf this parameter is set to 6, this parameter is used to specify Characters Used as separators. For exampleChr(9)
"," Indicates a comma, and ";" indicates a semicolon or a custom character. If this parameter is a string, only the first character of the string is used.
EditableVariantType. Optional. If the file is Microsoft Excel 4.0, the value of this parameter isTrueYou can open the macro to see it in the window. If the value of this parameter isFalseIf this parameter is omitted, the loaded macro is opened in a hidden mode and cannot be set as visible. This option cannot be used to load macros created by Microsoft Excel 5.0 or later. If the file is an Excel template, the parameter value isTrueThe specified template is opened for editing. The parameter isFalseYou can open a new workbook according to the specified template. The default value isFalse.
NotifyVariantType. Optional. If the value of this parameter isTrueTo add the file to the file notification list. Microsoft Excel opens the file in read-only mode and polls the file notification list. It notifies you when the file in the file notification list is available. If the value of this parameter isFalseIf this parameter is omitted, no notification is requested and no unavailable files can be opened.
ConverterVariantType. Optional. The index number of the first file converter used to open the file. First, use the specified file converter: If the converter cannot recognize this file, try all the converters. Converter IndexFileconvertersThe converter line number returned by the property.
AddtomruVariantType. Optional. If the value isTrueTo add the workbook to the list of recently used files. The default value isFalse.
LocalVariantType. Optional. If the value isTrueTo save the file in Microsoft Excel (including the control panel settings. If the value isFalse(Mo
Save the file in the language of Visual Basic for Applications (VBA), where Visual Basic
Applications (VBA) is a typical American English version installed, unless the workbooks. open of the VBA project comes from the old international
Xl5/95 VBA project.
CorruptloadVariantType. Optional. Can be one of the following constants:Xlnormalload,XlrepairfileAndXlextractdata. If no value is specified, the default value is normal, but if Excel has tried to open the file, it can be in the secure loading or data recovery status. The preferred value is normal. If an Excel file is stopped when it is opened, it is in the safe loading status. If Excel stops again, the data is restored.