Georges said:
In a LotusNotes dB I Create a spreadsheet from a view with the use
of 'CreateObject("Excel.Application")'
...
CreateObject is a function call and should return an Excel application
object referring to a running instance of Excel when successful.
Presumably you're assigning its result to a variable of type Object.
If so, and if there were only one workbook open in that Excel
instance, you could protect each worksheet and the workbook using code
similar to the following.
'NOTE: LotusScript code, **NOT** VBA code
Sub foo
Dim xl As Variant, wb As Variant
'possibly other code here
Set xl = createobject("Excel.Application")
Set wb = xl.workbooks.add
'possibly other code here
'note: Lotus was BRAINDEAD when they designed LotusScript
'Forall loop variables must be UNDECLARED when used,
'thus ws wasn't declared above
Forall ws In wb.Worksheets
'different passwords for different worksheets
'left as an exercise
ws.Protect "your worksheet password here"
End Forall
'possibly other code here
wb.Protect "your workbook password here", True, True
wb.SaveAs "your filename here", , _
"your file open password here", _
"your file modify password here", True
wb.close False
'possibly other code here
xl.Quit
'possibly other code here
End Sub