Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Files Open Read-Only | Excel Discussion (Misc queries) | |||
Can't Open a Read-Only file in Excel 03 | Excel Discussion (Misc queries) | |||
how do you switch from auto open | Excel Discussion (Misc queries) | |||
how do i open a file in excel that is encrypted or read only | Excel Discussion (Misc queries) | |||
Read only command line switch | Excel Discussion (Misc queries) |