Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 software programmers and website developers 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 developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 9th, 2005, 05:10 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?


Reply With Quote
  #2 (permalink)  
Old 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
Default

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

Reply With Quote
  #3 (permalink)  
Old June 9th, 2005, 08:07 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Reply With Quote
  #4 (permalink)  
Old June 9th, 2005, 08:29 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
XQuery from command line Tomi XSLT 2 January 16th, 2008 01:58 PM
Asp Command Line dizzy1 Classic ASP Basics 1 August 30th, 2007 06:32 PM
Command line switches jaucourt Flash (all versions) 0 December 31st, 2004 07:29 AM



All times are GMT -4. The time now is 02:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.