|
|
 |
| Excel VBA Discuss using VBA for Excel programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

June 9th, 2005, 05:10 AM
|
|
Authorized User
|
|
Join Date: Oct 2004
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
command line switches
I am launching Excel from a DOS command line along with the file to be opened as follows:-
c:\path\excel c:\path1\filename.xls
This works fine, but I wish to force excel to open this as read only. Is there a command line switch or other means of doing this?
|

June 9th, 2005, 05:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Location: Bournemouth, Dorset, United Kingdom.
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My first inclination is to suggest saving the workbook as readonly. Do this by going into the XL-[File]-[Save As]
In the Save as dialogue box go to [Tools]-[General Options], in options enter a password in the to Modify box. This will require the user to enter a password to allow full access or give a read only choice.
Cheers
Matt
|

June 9th, 2005, 08:07 AM
|
|
Authorized User
|
|
Join Date: Oct 2004
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I dont have an opportunity to do that with the file (it is created from another application). However I think i have found the syntax which is
c:\path\excel -R filename.xls
But I now need to open two files, one Read Only and the other not Read/Write.
|

June 9th, 2005, 08:29 AM
|
|
Authorized User
|
|
Join Date: Oct 2004
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OK, heres some more I found.
if I do:-
excel file1 file2 'then both open up Read Write
excel -R file1 file2 'then both open up as Read only
excel file1 -R file2 'then file1 opend RW and file2 opend up RO
excel file1 file2 -R 'then both open Read Write
What I need is file1 to be Read Only and file2 to be Read Write.
The reason is file2 will be the active window once the files have been opened.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |