Refresh docids from Excel

Hi All,

I need your assistance. I would like to refresh about 15000 records on the database. I have all the docids in an excel spreadsheets in Column A.

Is there a way to create an agent that takes the docids from Column A (Excel) and refresh those docids in a form called Clients.

I’m not much of a programmer but trying really hard.

Thanks for your help.

John

Subject: Refresh docids from Excel

What I would do is export the Excel file as a CSV, then in LS open the file, get each line, get the document by docid for each doc id found and use ComputeWithForm.

HTH

Geoff Poole

Subject: Code: Refresh docids from Excel

Here is your excel macro.

Private Sub Excel2Notes_WriteButton_Click()

Dim Msg

On Error GoTo ErrorHandler

Dim Style, Title, Help, Ctxt, Response, MyString

Msg = “You are about to update records in Notes! Do you want to continue ?” ’ Define message.

Style = vbYesNo + vbCritical + vbDefaultButton2 ’ Define buttons.

Title = “WARNING BE CAREFUL” ’ Define title.

Help = “” ’ Define Help file.

Ctxt = 1000

Response = MsgBox(Msg, Style, Title, Help, Ctxt)

If Response = vbYes Then

' No Action, continue with Sub

Else

MsgBox ("Aborted. Action has been cancelled")

Exit Sub

End If

Set objWorksheet = Application.ActiveWindow.ActiveSheet

strNotesServer = objWorksheet.Range(“H3”).Value 'put your server name in cell H3

strNotesDatabase = objWorksheet.Range(“J3”).Value 'put your notes database filepath in cell J3

Set objNotes = CreateObject(“Lotus.NotesSession”)

objNotes.Initialize

Set objDB = objNotes.GetDatabase(strNotesServer, strNotesDatabase)

Set objView = objDB.GetView(“(Excel2Notes)”)

intRow = 6 'what row to begin with

Do

strWkSht_Key = objWorksheet.Range(“A” + Trim(Str(intRow))).Value

If Len(strWkSht_Email) < 2 Then

If Val(strWkSht_Email) = 0 Then

Exit Do

End If

End If

Set objDoc = objView.GetDocumentByKey(strWkSht_Key)

If Not objDoc Is Nothing Then

Call objDoc.ComputeWithForm(False, False)

Call objDoc.Save(True, False)

intRow = intRow + 1

Loop

tmp = MsgBox(Prompt, vbOKOnly, CStr(intRow - 6) + " Records Updated")

ErrorHandler:

If Err.Number = 13 Then

strWkSht_Key = Trim(Str(objWorksheet.Range(“A” + Trim(Str(intRow))).Value))

Resume Next

End If

If Err.Number <> 0 Then

Msg = "Error # " & Str(Err.Number) & " was generated by " _

        & Err.Source & Chr(13) & Err.Description

MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext

Resume Next

End If

End Sub

Subject: Free Lotus Notes/Domino Import Utility

We have a Notes/Domino Import Utility you can freely download from our website that enables you to perform imports directly from several file formats (Excel, Microsoft Outlook, and other file formats) directly into any database.

You can set it up to read only the column you want from your Excel file and it will automatically lookup & update existing documents.

You can download it from:

Hope it helps.

Alex

Subject: Refresh docids from Excel

You can connect to an excel file and then read the column values in using odbc and the related notes classes but it is not for a beginner unless you fancy a steep learning curve.

A question that springs to mind is why are the document ids that you wish to refresh stored in an excel file?

The easiest way to do this would be to create a view that contains all the documents that you want to refresh and then run an agent using @Command( [ToolsRefreshAllDocs] ). Even if the view contains documents that you do not need to refresh as long as the refresh won’t damage those documents then it won’t cause any harm