Hi Martha,
I don't know if there's a better way but you can loop through Sheets collection and compare the names
llFound = .F.
FOR i=1 TO oWorkbook.Sheets.Count
IF UPPER(oWorkbook.Sheets.Item(i).Name) == UPPER("My Sheet Name")
llFound = .T.
EXIT
ENDIF
ENDFOR
llFound = .T.
TRY
oSheet = oWorkbook.Sheets.Item("My Sheet Name")
CATCH TO oExp WHEN oExp.ErrorNo = 1426 AND (UPPER("Invalid index") $ UPPER(oExp.Message))
llFound = .F.
ENDTRY
>
>I'm saving data off to an Excel file. As I do this I am creating a new worksheet and naming it based on a name the user supplies.
>
>IF the name of that worksheet already exists within that file I get a nasty little Excel generated message (very long and involved and probably not important if the following can be answered).
>
>Is there any way I can check to see if a worksheet with the same name already exists before I rename the new, blank worksheet created?
>
--sb--