Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xlDialogOpen arguments

I am trying to display the file Open dialog such that when the user selects
the particular file, it is automatically opened as Read-Only. I'm using:

Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm", Arg3:=True

Arg1 works so that only Book1.xlsm is shown but when I open the file, it is
not opened as read-only. Any ideas of what I'm doing wrong?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default xlDialogOpen arguments


xlDialogOpen
---------------
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

More generally: for all dialogs
-----------------------------------
type Application.Dialogs, then select 'Dialogs' and press F1 to get the
Help. There, click the 'Dialogs' link and finally on that page you have a
"see Built-in Dialog Box Argument Lists." link for all Dialogs.

Option.
---------
You can use the other dialog to open files. I personally prefer it:
Application.FileDialog(msoFileDialogOpen)
Check the help for more details.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

I am trying to display the file Open dialog such that when the user selects
the particular file, it is automatically opened as Read-Only. I'm using:

Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm", Arg3:=True

Arg1 works so that only Book1.xlsm is shown but when I open the file, it is
not opened as read-only. Any ideas of what I'm doing wrong?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xlDialogOpen arguments

Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
list of arguments shows the third argument as "read_only" so I'm assuming the
Arg3:=True should automatically open the file as read-only but setting the
argument to true has no effect. Any other ideas? Thanks

"sebastienm" wrote:


xlDialogOpen
---------------
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

More generally: for all dialogs
-----------------------------------
type Application.Dialogs, then select 'Dialogs' and press F1 to get the
Help. There, click the 'Dialogs' link and finally on that page you have a
"see Built-in Dialog Box Argument Lists." link for all Dialogs.

Option.
---------
You can use the other dialog to open files. I personally prefer it:
Application.FileDialog(msoFileDialogOpen)
Check the help for more details.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

I am trying to display the file Open dialog such that when the user selects
the particular file, it is automatically opened as Read-Only. I'm using:

Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm", Arg3:=True

Arg1 works so that only Book1.xlsm is shown but when I open the file, it is
not opened as read-only. Any ideas of what I'm doing wrong?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default xlDialogOpen arguments

For me (win2k/xl2k), using
Application.Dialogs(xlDialogOpen).Show arg3:=True
or
Application.Dialogs(xlDialogOpen).Show , , True
or
Application.Dialogs(xlDialogOpen).Show <file_name, , True

works fine and opens the selected file as read-only.

Now if it doesn't work for you , you may want to look at the
Application.FIleOpen which returns you the chosen file (String), then you
open the file with Workbooks.Open (<chosenFile, arg_list) where you can set
Read-Only to True.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
list of arguments shows the third argument as "read_only" so I'm assuming the
Arg3:=True should automatically open the file as read-only but setting the
argument to true has no effect. Any other ideas? Thanks

"sebastienm" wrote:


xlDialogOpen
---------------
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

More generally: for all dialogs
-----------------------------------
type Application.Dialogs, then select 'Dialogs' and press F1 to get the
Help. There, click the 'Dialogs' link and finally on that page you have a
"see Built-in Dialog Box Argument Lists." link for all Dialogs.

Option.
---------
You can use the other dialog to open files. I personally prefer it:
Application.FileDialog(msoFileDialogOpen)
Check the help for more details.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

I am trying to display the file Open dialog such that when the user selects
the particular file, it is automatically opened as Read-Only. I'm using:

Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm", Arg3:=True

Arg1 works so that only Book1.xlsm is shown but when I open the file, it is
not opened as read-only. Any ideas of what I'm doing wrong?

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xlDialogOpen arguments

Let me play with those options. Thanks Sebastien.

"sebastienm" wrote:

For me (win2k/xl2k), using
Application.Dialogs(xlDialogOpen).Show arg3:=True
or
Application.Dialogs(xlDialogOpen).Show , , True
or
Application.Dialogs(xlDialogOpen).Show <file_name, , True

works fine and opens the selected file as read-only.

Now if it doesn't work for you , you may want to look at the
Application.FIleOpen which returns you the chosen file (String), then you
open the file with Workbooks.Open (<chosenFile, arg_list) where you can set
Read-Only to True.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
list of arguments shows the third argument as "read_only" so I'm assuming the
Arg3:=True should automatically open the file as read-only but setting the
argument to true has no effect. Any other ideas? Thanks

"sebastienm" wrote:


xlDialogOpen
---------------
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

More generally: for all dialogs
-----------------------------------
type Application.Dialogs, then select 'Dialogs' and press F1 to get the
Help. There, click the 'Dialogs' link and finally on that page you have a
"see Built-in Dialog Box Argument Lists." link for all Dialogs.

Option.
---------
You can use the other dialog to open files. I personally prefer it:
Application.FileDialog(msoFileDialogOpen)
Check the help for more details.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

I am trying to display the file Open dialog such that when the user selects
the particular file, it is automatically opened as Read-Only. I'm using:

Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm", Arg3:=True

Arg1 works so that only Book1.xlsm is shown but when I open the file, it is
not opened as read-only. Any ideas of what I'm doing wrong?

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default xlDialogOpen arguments

Application.Dialogs.Item(xlDialogOpen).Show "Book1.xlsm", , True


--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"frice" wrote in message
...
Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
list of arguments shows the third argument as "read_only" so I'm assuming
the
Arg3:=True should automatically open the file as read-only but setting the
argument to true has no effect. Any other ideas? Thanks

"sebastienm" wrote:


xlDialogOpen
---------------
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

More generally: for all dialogs
-----------------------------------
type Application.Dialogs, then select 'Dialogs' and press F1 to get the
Help. There, click the 'Dialogs' link and finally on that page you have a
"see Built-in Dialog Box Argument Lists." link for all Dialogs.

Option.
---------
You can use the other dialog to open files. I personally prefer it:
Application.FileDialog(msoFileDialogOpen)
Check the help for more details.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

I am trying to display the file Open dialog such that when the user
selects
the particular file, it is automatically opened as Read-Only. I'm
using:

Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm",
Arg3:=True

Arg1 works so that only Book1.xlsm is shown but when I open the file,
it is
not opened as read-only. Any ideas of what I'm doing wrong?

Thanks



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xlDialogOpen arguments

Thanks Bob for the response. For some reason, that doesn't work in my
application. The file still doesn't open as read-only.

"Bob Phillips" wrote:

Application.Dialogs.Item(xlDialogOpen).Show "Book1.xlsm", , True


--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"frice" wrote in message
...
Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
list of arguments shows the third argument as "read_only" so I'm assuming
the
Arg3:=True should automatically open the file as read-only but setting the
argument to true has no effect. Any other ideas? Thanks

"sebastienm" wrote:


xlDialogOpen
---------------
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

More generally: for all dialogs
-----------------------------------
type Application.Dialogs, then select 'Dialogs' and press F1 to get the
Help. There, click the 'Dialogs' link and finally on that page you have a
"see Built-in Dialog Box Argument Lists." link for all Dialogs.

Option.
---------
You can use the other dialog to open files. I personally prefer it:
Application.FileDialog(msoFileDialogOpen)
Check the help for more details.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"frice" wrote:

I am trying to display the file Open dialog such that when the user
selects
the particular file, it is automatically opened as Read-Only. I'm
using:

Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm",
Arg3:=True

Arg1 works so that only Book1.xlsm is shown but when I open the file,
it is
not opened as read-only. Any ideas of what I'm doing wrong?

Thanks




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default xlDialogOpen arguments

so I'm assuming the Arg3:=True should automatically open the file as
read-only


The Args are used to preset dialog options, where they exist. The 'read
only' option check box has not existed since Excel 95.

You're going to have to switch to this to do what you want:

Dim FName As Variant
FName = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*")
If FName < False Then
Workbooks.Open Filename:=FName, ReadOnly:=True
End If

--
Jim
"frice" wrote in message
...
| Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
| list of arguments shows the third argument as "read_only" so I'm assuming
the
| Arg3:=True should automatically open the file as read-only but setting the
| argument to true has no effect. Any other ideas? Thanks
|
| "sebastienm" wrote:
|
|
| xlDialogOpen
| ---------------
| 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
|
| More generally: for all dialogs
| -----------------------------------
| type Application.Dialogs, then select 'Dialogs' and press F1 to get the
| Help. There, click the 'Dialogs' link and finally on that page you have
a
| "see Built-in Dialog Box Argument Lists." link for all Dialogs.
|
| Option.
| ---------
| You can use the other dialog to open files. I personally prefer it:
| Application.FileDialog(msoFileDialogOpen)
| Check the help for more details.
|
| --
| Regards,
| Sébastien
| <http://www.ondemandanalysis.com
|
|
| "frice" wrote:
|
| I am trying to display the file Open dialog such that when the user
selects
| the particular file, it is automatically opened as Read-Only. I'm
using:
|
| Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm",
Arg3:=True
|
| Arg1 works so that only Book1.xlsm is shown but when I open the file,
it is
| not opened as read-only. Any ideas of what I'm doing wrong?
|
| Thanks


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xlDialogOpen arguments

Thanks for the response, Jim. I guess I figured that the read-only argument
was the same as clicking the down arraow beside the Open button on the Open
dialog and selecting Open as Read-Only. What's also interesting is that I'm
using a MS Press book on Programming Excel 2003 and it specifically uses the
arg3:=True example to open the file as read-only.

"Jim Rech" wrote:

so I'm assuming the Arg3:=True should automatically open the file as
read-only


The Args are used to preset dialog options, where they exist. The 'read
only' option check box has not existed since Excel 95.

You're going to have to switch to this to do what you want:

Dim FName As Variant
FName = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*")
If FName < False Then
Workbooks.Open Filename:=FName, ReadOnly:=True
End If

--
Jim
"frice" wrote in message
...
| Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
| list of arguments shows the third argument as "read_only" so I'm assuming
the
| Arg3:=True should automatically open the file as read-only but setting the
| argument to true has no effect. Any other ideas? Thanks
|
| "sebastienm" wrote:
|
|
| xlDialogOpen
| ---------------
| 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
|
| More generally: for all dialogs
| -----------------------------------
| type Application.Dialogs, then select 'Dialogs' and press F1 to get the
| Help. There, click the 'Dialogs' link and finally on that page you have
a
| "see Built-in Dialog Box Argument Lists." link for all Dialogs.
|
| Option.
| ---------
| You can use the other dialog to open files. I personally prefer it:
| Application.FileDialog(msoFileDialogOpen)
| Check the help for more details.
|
| --
| Regards,
| Sébastien
| <http://www.ondemandanalysis.com
|
|
| "frice" wrote:
|
| I am trying to display the file Open dialog such that when the user
selects
| the particular file, it is automatically opened as Read-Only. I'm
using:
|
| Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm",
Arg3:=True
|
| Arg1 works so that only Book1.xlsm is shown but when I open the file,
it is
| not opened as read-only. Any ideas of what I'm doing wrong?
|
| Thanks



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xlDialogOpen arguments

Correction: The xlDialogOpen example showing arg3:=True appears in Excel 2007
help at: http://msdn2.microsoft.com/en-us/library/bb236937.aspx

"Jim Rech" wrote:

so I'm assuming the Arg3:=True should automatically open the file as
read-only


The Args are used to preset dialog options, where they exist. The 'read
only' option check box has not existed since Excel 95.

You're going to have to switch to this to do what you want:

Dim FName As Variant
FName = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*")
If FName < False Then
Workbooks.Open Filename:=FName, ReadOnly:=True
End If

--
Jim
"frice" wrote in message
...
| Thanks for the reponse Sebastien. In my app, I need to use xlDialogs. The
| list of arguments shows the third argument as "read_only" so I'm assuming
the
| Arg3:=True should automatically open the file as read-only but setting the
| argument to true has no effect. Any other ideas? Thanks
|
| "sebastienm" wrote:
|
|
| xlDialogOpen
| ---------------
| 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
|
| More generally: for all dialogs
| -----------------------------------
| type Application.Dialogs, then select 'Dialogs' and press F1 to get the
| Help. There, click the 'Dialogs' link and finally on that page you have
a
| "see Built-in Dialog Box Argument Lists." link for all Dialogs.
|
| Option.
| ---------
| You can use the other dialog to open files. I personally prefer it:
| Application.FileDialog(msoFileDialogOpen)
| Check the help for more details.
|
| --
| Regards,
| Sébastien
| <http://www.ondemandanalysis.com
|
|
| "frice" wrote:
|
| I am trying to display the file Open dialog such that when the user
selects
| the particular file, it is automatically opened as Read-Only. I'm
using:
|
| Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm",
Arg3:=True
|
| Arg1 works so that only Book1.xlsm is shown but when I open the file,
it is
| not opened as read-only. Any ideas of what I'm doing wrong?
|
| Thanks





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default xlDialogOpen arguments

The help files for Excel (and all of Office) have gotten continuously worse
since about Office 97; Jim's comment indicates that this topic hasn't been
updated since Excel 95. The help examples are poorly written and do not
often illustrate more than a rehashing of the syntax. When they are more
illustrative, like this example, they are incorrect. This is unfortunate.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"frice" wrote in message
...
Correction: The xlDialogOpen example showing arg3:=True appears in Excel
2007
help at: http://msdn2.microsoft.com/en-us/library/bb236937.aspx

"Jim Rech" wrote:

so I'm assuming the Arg3:=True should automatically open the file as
read-only


The Args are used to preset dialog options, where they exist. The 'read
only' option check box has not existed since Excel 95.

You're going to have to switch to this to do what you want:

Dim FName As Variant
FName = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*")
If FName < False Then
Workbooks.Open Filename:=FName, ReadOnly:=True
End If

--
Jim
"frice" wrote in message
...
| Thanks for the reponse Sebastien. In my app, I need to use xlDialogs.
The
| list of arguments shows the third argument as "read_only" so I'm
assuming
the
| Arg3:=True should automatically open the file as read-only but setting
the
| argument to true has no effect. Any other ideas? Thanks
|
| "sebastienm" wrote:
|
|
| xlDialogOpen
| ---------------
| 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
|
| More generally: for all dialogs
| -----------------------------------
| type Application.Dialogs, then select 'Dialogs' and press F1 to get
the
| Help. There, click the 'Dialogs' link and finally on that page you
have
a
| "see Built-in Dialog Box Argument Lists." link for all Dialogs.
|
| Option.
| ---------
| You can use the other dialog to open files. I personally prefer it:
| Application.FileDialog(msoFileDialogOpen)
| Check the help for more details.
|
| --
| Regards,
| Sébastien
| <http://www.ondemandanalysis.com
|
|
| "frice" wrote:
|
| I am trying to display the file Open dialog such that when the user
selects
| the particular file, it is automatically opened as Read-Only. I'm
using:
|
| Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm",
Arg3:=True
|
| Arg1 works so that only Book1.xlsm is shown but when I open the
file,
it is
| not opened as read-only. Any ideas of what I'm doing wrong?
|
| Thanks





  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default xlDialogOpen arguments

Correction: The xlDialogOpen example showing arg3:=True appears in Excel
2007 help


That is a riot. It's good to see that, just like the designers and
developers, the help writers do not actually use Excel.

--
Jim
"frice" wrote in message
...
| Correction: The xlDialogOpen example showing arg3:=True appears in Excel
2007
| help at: http://msdn2.microsoft.com/en-us/library/bb236937.aspx
|
| "Jim Rech" wrote:
|
| so I'm assuming the Arg3:=True should automatically open the file as
| read-only
|
| The Args are used to preset dialog options, where they exist. The 'read
| only' option check box has not existed since Excel 95.
|
| You're going to have to switch to this to do what you want:
|
| Dim FName As Variant
| FName = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*")
| If FName < False Then
| Workbooks.Open Filename:=FName, ReadOnly:=True
| End If
|
| --
| Jim
| "frice" wrote in message
| ...
| | Thanks for the reponse Sebastien. In my app, I need to use xlDialogs.
The
| | list of arguments shows the third argument as "read_only" so I'm
assuming
| the
| | Arg3:=True should automatically open the file as read-only but setting
the
| | argument to true has no effect. Any other ideas? Thanks
| |
| | "sebastienm" wrote:
| |
| |
| | xlDialogOpen
| | ---------------
| | 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
| |
| | More generally: for all dialogs
| | -----------------------------------
| | type Application.Dialogs, then select 'Dialogs' and press F1 to get
the
| | Help. There, click the 'Dialogs' link and finally on that page you
have
| a
| | "see Built-in Dialog Box Argument Lists." link for all Dialogs.
| |
| | Option.
| | ---------
| | You can use the other dialog to open files. I personally prefer it:
| | Application.FileDialog(msoFileDialogOpen)
| | Check the help for more details.
| |
| | --
| | Regards,
| | Sébastien
| | <http://www.ondemandanalysis.com
| |
| |
| | "frice" wrote:
| |
| | I am trying to display the file Open dialog such that when the
user
| selects
| | the particular file, it is automatically opened as Read-Only. I'm
| using:
| |
| | Application.Dialogs.Item(xlDialogOpen).Show Arg1:="Book1.xlsm",
| Arg3:=True
| |
| | Arg1 works so that only Book1.xlsm is shown but when I open the
file,
| it is
| | not opened as read-only. Any ideas of what I'm doing wrong?
| |
| | Thanks
|
|
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
xlDialogOpen jamie Excel Programming 0 August 9th 07 08:18 PM
Using cmdlg xlDialogOpen PO Excel Programming 2 April 25th 07 05:44 PM
xlDialogOpen get it to return Path DMc2005 Excel Discussion (Misc queries) 1 October 2nd 05 03:47 PM
xlDialogOpen get it to return Path DMc2005 Excel Programming 1 October 2nd 05 03:47 PM
xlDialogOpen.Show or Activeworkbook.Path? Mike Echo Excel Worksheet Functions 2 January 29th 05 09:51 AM


All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"