If Ucase$(o.Name) = "LOTUSSPREADSHEET1" Then
I think you should try
If Ucase$(o.Name(0)) = "LOTUSSPREADSHEET1" Then
Its much easier to find such little bugs if you are using errorhandling.
Function ReturnSheet(doc As notesdocument) As Variant
On Error goto iHaveVotedRepublicans
Forall o In doc.EmbeddedObjects
If Ucase$(o.Name) = "LOTUSSPREADSHEET1" Then
Set RetornaSheet = o.object
Exit Forall
End If
End Forall
exit function
iHaveVotedRepublicans:
ReturnSheet = false
msgbox |Error in Function Returnsheet | & Error$(Err) & | in line:| & Cstr(Erl)
' or use print
End Function
---