Share via

Workbook opens as readonly

Anonymous
2011-09-23T20:52:22+00:00

Hi,

I’m using the following function to open an xls workbook from MS Access.

Dim xlApp as Excel.Application, wkb as Excel.Workbook

Set xlApp = CreateObject(“Excel.Application”)

xlApp.Visible = True

Set wkb = xlApp.Workbooks.Open(FileName:=“C:\myFile.xls”, ReadOnly:=False)

And when the workbook opens, its title is:

“myFile.xls [Read-Only] [Compatibility Mode] – Microsoft Excel”

How come I cannot open it in normal mode? Is it because I am trying to open an xls in 2007??

Thanks, in advance, for any relevant suggestion.

Best regards

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-09-24T01:22:27+00:00

I am perplexed because I use similar code and never had such problems.

Here are a couple things to try/check.

What happens when you open the Workbook manually?  Is it in read-only as well?

Set wkb = xlApp.Workbooks.Open("C:\myFile.xls")

FYI: Opening an *.xls in Excel 2007 should have no impact on being able to edit and save changes to the workbook.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-09-26T08:58:35+00:00

    It was my fault!

    I have linked this workbook in my Access db then made a select query without closing the recordset before opening the file.

    Was this answer helpful?

    0 comments No comments