ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Excel file as Read Only with code, (https://www.excelbanter.com/excel-programming/298178-open-excel-file-read-only-code.html)

yogendra joshi

Open Excel file as Read Only with code,
 
You can use Open Method with optional parameter ReadOnly = True

See following code

Sub open_Read_Only()
Workbooks.Open Filename:="D:/test.xls", ReadOnly:=True
End Sub

Hope this helps

~Yogendra


Jason Wooten wrote:
I have several spreadsheets that are Read Only, Every macro that I have opens the files but ask if you want to open as Read Only or not,
Is there any way that I can write something that will open the file as Read Only or Read Write without it asking.
I am wanting to put this in the Code, but do not know how..

Thanks in advance for your help..

Jason



Jason Michael

Open Excel file as Read Only with code,
 
thanks alot of the response.
Okay one more question
Can I make a file read only with code
and can I can code enter a password for a workbook

Thanks Again for all your help

Jason


All times are GMT +1. The time now is 03:06 AM.

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