EXCEL - filling in a protected workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to write some code in an Ms Access application which will fill in
an Excel workbook. The Excel workbook is protected, I don't know the password
or have much chance of getting it. Anyway the fields I want to fill in I can
enter data into them when I open the workbook in Excel.

But if I try to fill the same fields in from code in Ms Access I get the
following error:

Run-time error '1004';

The cell or chart you're trying to change is protected and therefore
read-only.


I've tried the following lines and both give me the same error:

ActiveWorkbook.Sheets(3).Cells(2, 3).Value = "21/07/06"

ActiveWorkbook.Sheets(3).Range("B3").Value = "21/07/06"


Can anyone help? Is there a way I can code it so that I can update those
cells that are actually updatable thru Excel itself?
 
=?Utf-8?B?TWlndWVsIEEuIFZlbGV6?=
I'm trying to write some code in an Ms Access application which will
fill in an Excel workbook. The Excel workbook is protected, I don't
know the password or have much chance of getting it. Anyway the fields
I want to fill in I can enter data into them when I open the workbook
in Excel.

You'll get more help in a group like m.p.excel.programming Although the
code you are having difficulty with is hosted in Access, it's still a
problem with the Excel object model.

Best of luck

Tim F
 
Back
Top