ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening Excel Workbook from Word using VBA - Always Read Only (https://www.excelbanter.com/excel-programming/281516-opening-excel-workbook-word-using-vba-always-read-only.html)

Alan

Opening Excel Workbook from Word using VBA - Always Read Only
 

Hi All,

I wasn't sure whether this should be a Word or Excel query so I have
cross-posted. Apologies if anyone objects!

I am using the following code in a module in Word to open an existing
Excel document:


Sub Open_Plan()

Dim xls As Object

Dim wrk As Object

Dim xlfilename As String

xlfilename = "F:\Alan\Plan.xls"

Set xls = CreateObject("Excel.Application")

xls.Visible = True

Set wrk = xls.workbooks.Open(FileName:=xlfilename, Updatelinks:=0,
ReadOnly:=False, Password:="password")

End Sub



This works fine, except that it seems to skip or ignore the 'ReadOnly
= FALSE' argument, and the file still opens as Read Only every time.

I am stumped as to how to get around this.

Thanks in advance for any help you can provide.

Alan.





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

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