• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

how can GET arg1-arg30 in xlDialogOpen of EXCEL?

hello, everyone.

If I used followed statement in EXCEL,
    Application.Dialogs(xlDialogOpen).Show arg3:=True
it can popup a file-open-dialog and open a file with read-only.

 But how can I get the args which selected in the file-open-dialog?

1.  I want to GET the all args value which set in file-open-dialog, i.e. , if i changed directory in file-open-dialog, how to get the directoryname after press "OK"?

2.  where can get the explanation of all args such as file_text, update_links, read_only, format, ...

best regards.
  • 3
1 Solution
Hi WanNing, you could've asked this in your previous question no need to close things down when it isn't clear enough you can ask for more feeback from us...

from the old vba macro help for excel can't find it righ away as download


Equivalent to choosing the Open command from the File menu. Opens an
existing workbook.


OPEN(file_text, update_links, read_only, format, prot_pwd,
write_res_pwd, ignore_rorec, file_origin, custom_delimit, add_logical,
editable, file_access, notify_logical, converter)
OPEN?(file_text, update_links, read_only, format, prot_pwd,
write_res_pwd, ignore_rorec, file_origin, custom_delimit, add_logical,
editable, file_access, notify_logical, converter)

File_text    is the name, as text, of the workbook you want to open.
File_text can include a drive and path, and can be a network pathname.
In the dialog-box form in Microsoft Excel for Windows, file_text can
include an asterisk (*) to represent any sequence of characters and a
question mark (?) to represent any single character.
Update_links    specifies whether and how to update external and remote
references. If update_links is omitted, Microsoft Excel displays a
message asking if you want to update links.

If update_links is      Then Microsoft Excel

0      Updates neither external nor remote references
1      Updates external references only
2      Updates remote references only
3      Updates external and remote references

Note      When you are opening a file in WKS, WK1, or WK3 format, the
update_links argument specifies whether Microsoft Excel generates charts
from any graphs attached to the WKS, WK1, or WK3 file.

If update_links is      Charts are

0      Not created
2      Created

Read_only    corresponds to the Read Only check box in the Open dialog
box. If read_only is TRUE, the workbook can be modified but changes
cannot be saved; if FALSE or omitted, changes to the workbook can be
Format    specifies what character to use as a delimiter when opening
text files. If format is omitted, Microsoft Excel uses the current
delimiter setting.

If format is      Values are separated by

1      Tabs
2      Commas
3      Spaces
4      Semicolons
5      Nothing
6      Custom characters

Prot_pwd    is the password, as text, required to unprotect a protected
file. If prot_pwd is omitted and file_text requires a password, the
Password dialog box is displayed. Passwords are case-sensitive.
Passwords are not recorded when you open a workbook and supply the
password with the macro recorder on.
Write_res_pwd    is the password, as text, required to open a read-only
file with full write privileges. If write_res_pwd is omitted and
file_text requires a password, the Password dialog box is displayed.

Ignore_rorec    is a logical value that controls whether the read-only
recommended message is displayed. If ignore_rorec is TRUE, Microsoft
Excel prevents display of the message; if FALSE or omitted, and if
read_only is also FALSE or omitted, Microsoft Excel displays the alert
when opening a read-only recommended workbook.
File_origin    is a number specifying whether a text file originated on
the Macintosh or in Windows.

File_origin      Original operating environment

1      Macintosh
2      Windows (ANSI)
3      MS-DOS (PC-8)
Omitted      Current operating environment

Custom_delimit    is the character you want to use as a custom delimiter
when opening text files.

Custom_delimit is text or a reference or formula that returns text, such
as CHAR(124).
      Custom_delimit is required if format is 6; it is ignored if format is
not 6.
      Only the first character in custom_delimit is used.

Add_logical    is a logical value that specifies whether or not to add
file_text to the open workbook. If add_logical is TRUE, the document is
added; if FALSE or omitted, it is not added. This argument is for
compatibility with workbooks from Microsoft Excel version 4.0.
Editable    is a logical valule that corresponds to opening a file (such
as a template) while holding down SHIFT key. If TRUE, editable is the
equivalent to holding down the SHIFT key while choosing the OK button in
the Open dialog box. If FALSE or omitted, this argument is ignored.

File_access     is a number specifying how the file is to be accessed.
If the file is being opened for the first time, this argument is
ignored. If the file is already opened, this argument determines how to
change the user's access permissions for the file.

File Access      How Accessed

1      Revert to saved copy
2      Change to read/write access
3      Change to read only access

Notify_logical    is a logical value that specifies whether the user
should be notified when the shared document is available to be opened
across a network. If TRUE, the user will be notified when the document
is available to be opened. If FALSE or omitted, the user will not be
notified when the file available to be opened.
Converter     is a number corresponding to the file converter to use to
open the file. Normally, Microsoft Excel automatically determines which
file converter to use; therefore, this argument can usually be excluded.
If you want to be certain, however, that a specific manually installed
converter be used, then include this argument. Use GET.WORKSPACE(62) to
determine which numbers corresponds to all of the installed converters.

Hi, what are you trying to do with the file open dialog, maybe when you explain what the purpose is we can provide some suggestions on how to get there


for the download of the macro help file of my previous comment

WanNingAuthor Commented:
oh, thank you very much!
glad i could help

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now