p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

Go Back   p2p.wrox.com Forums > Microsoft Office > Excel VBA > Excel VBA
I forgot my password
Register Now
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 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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 9th, 2005, 05:10 AM
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 9th, 2005, 05:15 AM
Friend of Wrox
Points: 360, Level: 6
Points: 360, Level: 6 Points: 360, Level: 6 Points: 360, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old June 9th, 2005, 08:07 AM
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old June 9th, 2005, 08:29 AM
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
XQuery from command line Tomi XSLT 2 January 16th, 2008 12:58 PM
Command line build PhilS BOOK: Visual Basic 2005 with .NET 3.0 Programmer's Reference ISBN: 978-0-470-13705-5 1 December 14th, 2007 08:44 AM
Asp Command Line dizzy1 Classic ASP Basics 1 August 30th, 2007 06:32 PM
The Windows Command Line cwebb Reader Surveys 35 January 18th, 2005 05:23 AM
Command line switches jaucourt Flash (all versions) 0 December 31st, 2004 06:29 AM



All times are GMT -4. The time now is 12:37 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc