4005 entry not found in index

Hi

I’m navigating a view for all available categories in it through an agent, to generate an Excel report. In Local it works fine as expected but on server some times it works fine and sometimes it fails to navigate to the next category after navigating the first category and raises the error message “4005 entry not found in index(viewname)”

Please help me!!!

Regards

Khader

Subject: 4005 entry not found in index

check for sorting once and what is the lookup synatx usingif that particular item is not available also entry not found index will comm

to remove this write failsilent in every lookup

s

Subject: RE: 4005 entry not found in index

I think my query has been misunderstood totally. Please check the query that I have posted earlier. Below is the code that I’m using.

Sub AllFunctionsReport

On Error Goto  PrintErr	

Set nav =thisview.CreateViewNav

Set entrya=nav.GetFirst

Dim object As NotesEmbeddedObject 

Dim xlApp As Variant

Dim oWorkbook As Variant   	

Set xlApp = CreateObject("Excel.Application") 

xlApp.Visible = True 'set to visible, this can be moved to the end if you wish	

Set oworkbook = xlApp.Workbooks 'handle to Workbook

oworkbook.Add 

	'giving the header names in excel

xlApp.cells(1,1) = "EmployeeName" 

xlApp.cells(1,2) = "EmployeeCode" 

xlApp.cells(1,3) = "FunctionName" 

xlApp.cells(1,4) = "SubFunction" 	

xlApp.cells(1,5) = "ReportingManager" 	

xlApp.cells(1,6) = "WeekNo" 	

xlApp.cells(1,7) = "CreatedDate" 

’ xlApp.cells(1,7) = “ToDate”

xlApp.cells(1,8) = "Category" 

xlApp.cells(1,9) = "Activity" 	

xlApp.cells(1,10) = "ProjectCode" 	

xlApp.cells(1,11) = "ProjectName" 	

xlApp.cells(1,12) = "FromTime" 

xlApp.cells(1,13) = "ToTime" 

xlApp.cells(1,14) = "WorkingHrs" 

xlApp.cells(1,15) = "Status" 

xlApp.cells(1,16) = "Remarks" 

	'this highlights the headings 	

xlApp.application.Rows("1:1").Select

With xlApp.application.Selection.Font

	.bold = True

	.ColorIndex = 00

	.Name = "Arial"

	.Size = 10

End With

'this autofits the columns

xlApp.cells.select

xlApp.selection.Columns.AutoFit 

xlApp.application.rows("1:1").Select



i = 2'start from second row

While Not entrya Is Nothing

	If entrya.IsCategory Then

		If entrya.ColumnValues(0)<>"" Then

			Set entryb=nav.GetChild(entrya)

			While Not entryb Is Nothing

				Set thisDoc=entryb.Document

				If Not thisDoc Is Nothing Then

					fdate=doc.FromDate(0)

					tdate=doc.ToDate(0)

					For dat=fdate To tdate

						firsttime=0

						cnt=Cint(thisDoc.SetNoInt(0))

						cnt=cnt+1

						For j=1 To cnt

							str1=thisDoc.GetItemValue("Date_"&j)(0)

							If str1<>"" Then

								If Cstr(str1)=Cstr(dat) Then

									EmployeeName$=thisDoc.Name(0)

									EmployeeCode$ = thisDoc.EmpCode(0)

									FunctionName$ = thisDoc.Function(0)

									SubFunction$ = thisDoc.SubFunction(0)

									Dim nam As New NotesName(thisDoc.ReportingTo(0))

									ReportingManager$=nam.Common

									WeekNo$ = Cstr(thisDoc.weekN(0))

									CreatedDate$=Cstr(thisDoc.GetItemValue("Date_"&j)(0))

									Category$ = thisDoc.GetItemValue("Cat_"&j)(0)

									Activity$ = thisDoc.GetItemValue("ActivityDesc_"&j)(0)

									ProjectCode$ = Cstr(thisDoc.GetItemValue("ProjectNo_"&j)(0))

									ProjectName$=thisDoc.GetItemValue("ProjectName_"&j)(0)

									FromTime$ =Cstr(thisDoc.GetItemValue("Frmtime_"&j)(0)) 

									ToTime$ = Cstr(thisDoc.GetItemValue("Totime_"&j)(0))

									WorkingHrs$ = Cstr(thisDoc.GetItemValue("Timediff_"&j)(0)) 

									Status$ = thisDoc.Status(0)

									Remarks$ = thisDoc.GetItemValue("ActRemarks_"&j)(0)

		'___ put values to the row

									xlApp.Range ( "A" & Cstr ( i ) ).Value = EmployeeName$

									xlApp.Range ( "B" & Cstr ( i ) ).Value = 	EmployeeCode$

									xlApp.Range ( "C" & Cstr ( i ) ).Value = FunctionName$

									xlApp.Range ( "D" & Cstr ( i ) ).Value = SubFunction$

									xlApp.Range ( "E" & Cstr ( i ) ).Value = ReportingManager$

									xlApp.Range ( "F" & Cstr ( i ) ).Value = WeekNo$

									xlApp.Range ( "G" & Cstr ( i ) ).Value = CreatedDate$

	'	xlApp.Range ( "G" & Cstr ( i ) ).Value = 	ToDate$ 

									xlApp.Range ( "H" & Cstr ( i ) ).Value = Category$ 

									xlApp.Range ( "I" & Cstr ( i ) ).Value = Activity$

									xlApp.Range ( "J" & Cstr ( i ) ).Value = ProjectCode$

									xlApp.Range ( "K" & Cstr ( i ) ).Value = ProjectName$

									xlApp.Range ( "L" & Cstr ( i ) ).Value = FromTime$

									xlApp.Range ( "M" & Cstr ( i ) ).Value = ToTime$

									xlApp.Range ( "N" & Cstr ( i ) ).Value = 	WorkingHrs$ 

									xlApp.Range ( "O" & Cstr ( i ) ).Value = Status$ 

									xlApp.Range ( "P" & Cstr ( i ) ).Value = Remarks$

									i = i + 1		

								End If

							End If

						Next

					Next

				End If

				Set entryb=nav.GetNextSibling(entryb)

				Set thisDoc=Nothing

			Wend

		End If

	End If

	Set entrya=nav.GetNextCategory(entrya)

Wend

Exit Sub

PrintErr:

Msgbox "Code - " & Str(Err) & ": " & Error$ + ". (onLine " & Str(Erl) & ").",,"Error"

Exit Sub  	

End Sub

Subject: RE: 4005 entry not found in index

if you are using caregory views for exporting you will get error so to avoid this you create on hidden you with same view how you are using just remove the category and export and check for duplication values also\after exporting toexcel sheet you filter theexcel sheet then everything will come in categorised way