Cecchini del codice, vi prego, datemi una mano ad abbattere l\'errore infame! Ho del codice dentro una script library che mi fa impazzire. Non ne esco più! ecco lo stralcio... Chiamo la importDoc ________________________________________________________ Sub importDoc(chiave As String) On Error Goto errore Dim key As String Dim docconfig As NotesDocument Dim docsorgente As NotesDocument Dim dbsorgente As String Dim vistasorgente As String Dim serversorgente As String Dim n As Integer Dim ntot As Integer Dim ntot2 As Integer Dim listasorgente As Variant Dim listadestinazione As Variant Dim valore As String Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument If chiave = "" Then Msgbox "Non è possibile accedere alla funzione senza avere impostato la chiave." & Chr(10) _ & "Contattare l\'amministratore Lotus!" Exit Sub End If key = genKey(chiave) Msgbox key Set docconfig = getDocConfig(key) \' <-- PUNTO DELL\'ERRORE DOCCONFIG TORNA NOTHING If docconfig Is Nothing Then Exit Sub End If ..... _________________________________________________ Function getDocConfig( key As String) As NotesDocument On Error Goto errore Dim session As New NotesSession Dim view As NotesView Dim doc As NotesDocument Dim db As NotesDatabase Set db = session.GetDatabase("serverXXX/server/IT","Utilita\importcli.nsf", False ) If db Is Nothing Then Messagebox"COMANDO NON DISPONIBILE! Assicurarsi di essere connessi alla rete e ritentare l\'operazione.", 048,"Impossibile connettersi al server!" Set getDocConfig = Nothing Exit Function End If Set view = db.GetView ("BEkey" ) Set doc = view.GetDocumentByKey(key) If doc Is Nothing Then Messagebox"COLLEGAMENTO AL DATABASE NON TROVATO! Controllare il documento di configurazione", 048,"Documento di configurazione!" Set getDocConfig = Nothing Exit Function End If Set getDocConfig = doc Exit Function errore: Msgbox "Error" & Str(Err) & ": " & Error$ & " riga " & Erl & Chr(10) _ & "ScriptLibrary: importDoc - Funzione: getDocConfig" End Function ___________________________________________________________ La getDocConfig() non mi torna errore, ne la sub principale importDoc() ... prima di uscire dalla funzione è valorizzata correttamente al valore di doc. All\'uscita docconfig mi torna NOTHING!! Perchè??? Grazie B.
|