View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
Veign Veign is offline
external usenet poster
 
Posts: 1
Default Open Excel from VB using Read-Only switch?

Check out this code:
http://www.veign.com/vrc_codeview.asp?type=app&id=61

Note the read only flag in the Open method of the Workbooks object.

--
Chris Hanscom
MVP (Visual Basic)
http://www.veign.com
--

"Ed" wrote in message
...
I'm trying to get my Visual Basic (6.0, SP4) app to open an Excel 2000

file
as Read-Only. I read two Knowledge Base articles (#211481 and 291288)

that
showed the switches used by Excel, and how to build a command line

statement
using them. The Read-Only switch was /r, and was shown as /r <filename.
So I put the following in my Run box:
/r "C:\Documents and Settings\emillis\TestFolder\TestBook.xls"

No go. Couldn't find filename "/r"???

So I put:

"C:\Documents and Settings\emillis\TIR 05 May 2004\TestBook.xls" /r

Now it can't find "C:\Documents"???



Can anyone help me with this - or a better - method of opening a specific
Excel file as Read-Only from VB?



Thanks.

Ed