I want to open office files say...excel in read only mode thru my vba.can anyone plz help me out.i can open them but cant specify the access modes.
can anybody please help me out...... :ehh:
Printable View
I want to open office files say...excel in read only mode thru my vba.can anyone plz help me out.i can open them but cant specify the access modes.
can anybody please help me out...... :ehh:
Why don't you change the file attributes to Read Only before you open it? ;) Or can't you change file attributes in VBA?
The best way would be to use Command Line switches. To open a file as Readonly you can useCode:Excel.EXE /r myFile.xls
:)VB Code:
Dim oApp As Excel.Application Set oApp = New Excel.Application oApp.Workbooks.Open Filename:="C:\MyFile.xls", ReadOny:=True
Ps, Congrats Shuja Ali on your 700 posts! :thumb:
Thanks :)Quote:
Originally Posted by RobDog888
:) Thanks a lot.....
This helped me again.. :wave:
If this is resolved, please pull down the Thread Tools menu and click the Mark Thread Resolved button. That will let everyone know that you have your answer.Quote:
Originally Posted by cswaroopsaha
Thank you. :)