Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
xlDialogOpen | Excel Programming | |||
Using cmdlg xlDialogOpen | Excel Programming | |||
xlDialogOpen get it to return Path | Excel Discussion (Misc queries) | |||
xlDialogOpen get it to return Path | Excel Programming | |||
xlDialogOpen.Show or Activeworkbook.Path? | Excel Worksheet Functions |