Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2005, 05:10 AM
Authorized User
 
Join Date: Oct 2004
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?


 
Old June 9th, 2005, 05:15 AM
Friend of Wrox
 
Join Date: Jan 2005
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

 
Old June 9th, 2005, 08:07 AM
Authorized User
 
Join Date: Oct 2004
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.

 
Old June 9th, 2005, 08:29 AM
Authorized User
 
Join Date: Oct 2004
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.







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





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