Locking an Excel cell from Access

ShiftyJaffa

Registered User.
Local time
Today, 12:58
Joined
Nov 10, 2004
Messages
36
Hi

I'm trying to lock a cell on an excel template, but from access. The Excel template is not my own and has 2 buttons which lock the upper and lower half of each sheet prompting the user to enter a password. I want to populate the upper half from access and lock those cells automatically (with a password if possible, but not essential).
I'm not very familiar with Excel but believe all the cell's have a locked flag set by default which comes into effect if I protect the sheet. Trouble is, if I just get a command to protect the sheet will it protect the bottom half also? Is it possible to lock seperate ranges of cells on the same sheet with different passwords?

I've searched the forums here already with no luck, here's a bit of what I have

Set xl = CreateObject("Excel.Application")
xl.Workbooks.Open DatabasePath & "\dwp.xlt"
xl.Sheets(1).Activate
xl.Range("A3").Select
xl.ActiveCell.Value = lstDefs.Column(3, Count)

Any help would be appreciated.

Thanks

Paul
 

Users who are viewing this thread

Back
Top Bottom