ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Excel from VB using Read-Only switch? (https://www.excelbanter.com/excel-programming/298175-open-excel-vbulletin-using-read-only-switch.html)

Ed[_18_]

Open Excel from VB using Read-Only switch?
 
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



Veign

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





Ed[_18_]

Open Excel from VB using Read-Only switch?
 
Thank you!!

Ed

"Veign" wrote in message
...
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








All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com