Hey all,

On some occasions, I'm getting a warning message when opening a worksheet (found in another workbook) into my current workbook... The open still works fine, I'm just bothered by two warning messages that pop up.. and I can't figure out how to get rid of them.

the warning message reads: A formula or sheet you want to move or copy contains the name 'Leach', which already exists on the destination worksheet. Do you want to use this version of the name?
To use the name as defined in the destination sheet, click Yes.
To rename the range referred to in the formula or worksheet, click No, and enter a new name in the Name Conflict dialog box.

I don't ever remember naming a range in the saved sheet... Is there a way to check if I have any named ranges on a certain sheet? Or is there some code that can simply bypass this warning message? My code to open the sheet is as follows: Thanks much!

vb Code:
  1. Application.DisplayAlerts = False
  2. Dim sfilename As String
  3. 'Show the open dialog and pass the selected _
  4. 'file name To the String variable "sFileName"
  5. sfilename = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls", Title:=vNum)
  6. 'They have cancelled.
  7. If sfilename = "False" Then Exit Sub
  8. Dim temp As String
  9. temp = spliceFileNameEnd2(sfilename)
  10. For Each shtnext In Sheets
  11.     If shtnext.Name = "nindex" Then 'Search/Delete charts w/ same name
  12.         Application.DisplayAlerts = False 'No delete prompt
  13.         Sheets("nindex").Delete
  14.         Application.DisplayAlerts = True
  15.     End If
  16. Next shtnext
  17. Workbooks.Open FileName:=sfilename
  18. Dim found As Boolean
  19. found = False
  20. For Each shtnext In Sheets
  21.     If shtnext.Name = "nindex" Then
  22.         found = True
  23.         Exit For
  24.     End If
  25. Next shtnext
  26. If found = False Then
  27.     Workbooks(temp).Close SaveChanges:=False
  28.     MsgBox ("No N-Index File was found in that file.")
  29.     Sheets.Add
  30.     ActiveSheet.Name = "nindex"
  31.     Exit Sub
  32. End If
  33. Sheets("nindex").Copy After:=Workbooks("NLEAPGIS10.xls").Sheets(ThisWorkbook.Sheets.Count)
  34. Workbooks(temp).Close SaveChanges:=False
  35.  
  36. Application.DisplayAlerts = True