Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2003 protect formula form acidental type over 1

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I am using Access to partially fill in a spreadsheet from an .XLT file. There are formulas in a few columns.
What can I do to prevent users from accidentally typing over the formulas of the spreadsheet?
Here is my code for reference.
Code:
    Dim oApp As Object
    Dim SheetName As String
    Set oApp = CreateObject("Excel.Application")
    
    'load document
    oApp.Workbooks.Add ("C:\AirMonitoring\Personnel Air Sampling Log.xlt")
    
    ' save as new document
    SheetName = "C:\AirMonitoring\Spreadsheets\PersonnelAirSamplingLog-" & Me.Project_Number & ".xls"
    oApp.ActiveWorkbook.SaveAs SheetName
    
   ' make Excel visible
    oApp.Visible = True

    ' fill in cells
    oApp.Application.Cells(2, 2).Value = Me.Facility
   …

TIA

DougP, MCP, A+
 



Hi,

1. Unlock all other cells that the user CAN change.

2. Protect the sheet.

Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top