Autor Thema: Notes <> Excel  (Gelesen 1583 mal)

Offline feargus

  • Aktives Mitglied
  • ***
  • Beiträge: 144
  • Geschlecht: Männlich
  • Und welche Farbe soll die Datenbank haben?
Notes <> Excel
« am: 25.04.02 - 09:00:57 »
hat jemand rein Zufällig was zur Hand um Daten von Excel nach Notes bzw von Notes nach Exel zu schreiben ?

Das war irgendetwas mit create.objekt....
« Letzte Änderung: 01.01.70 - 01:00:00 von 1034200800 »
2 x 6.5.5 Mail Server on Windos 2003
2 x 6.5.5 Application Server on Windos 2003

Clients:
500 User (Win.XP) 6.5.5

Offline eknori

  • @Notes Preisträger
  • Moderator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 11.728
  • Geschlecht: Männlich
Re: Notes <> Excel
« Antwort #1 am: 25.04.02 - 09:19:50 »
Hier der Code Excel 2 Notes :
Notes 2 Excel hatte ich hier mal was gepostet
http://www.atnotes.de/cgi-bin/yabb/YaBB.pl?board=Downloads;action=display;num=1014050197

Sub Initialize

' ==> This agent picks the data from the excel sheet and crates a document for each row
Dim sess As New notessession
Dim db As notesdatabase
Dim vw As notesview
Dim Doc As notesdocument
Dim report As notesdocument
Dim dataSheet As Variant

On Error Goto errorhandle

Set db = sess.currentdatabase

sheetLoc$ = Inputbox("Enter the locaiton of Excel Sheet","Location","c:\temp\MailMerge.xls") ' ==> The Excel Sheet file path

If sheetLoc$ = "" Then
Msgbox "The Excel sheet locaiton is mandatory. Please re-run the macro again"
Exit Sub
End If

Set dataSheet = GetObject(sheetLoc$ )

%REM
This check did not work
If dataSheet = VT_NULL Then
Msgbox "Notes could not find the specified file in the locaiton. Please re-run the macro again with correct locaiton and filename"
Exit Sub
End If
%END REM


' ==> Initialise progress bar. These functions are available in nnotesws.dll library
Dim hwnd As Long
hwnd = NEMProgressBegin(NPB_ONELINE)
NEMProgressSetText hwnd, "Please wait while data is processed", "Please wait"


rowCount = 2
maxCount = 1

' ==> Max number of rows, for the progress bar
While Not (dataSheet.Cells(maxCount,1).Value = "" )
maxCount = maxCount + 1
Wend

' ==> Process data from the Excel sheet. For every row, create a doc.
While Not (dataSheet.Cells(rowCount,1).Value = "" )
Set report = db.createdocument
report.Form = "Test"
' report.ComputewithForm True, False
report.Field1 = dataSheet.Cells(rowCount,1).Value
report.Field2 = dataSheet.Cells(rowCount,2).Value
report.Field3 = dataSheet.Cells(rowCount,3).Value
report.Field4 = dataSheet.Cells(rowCount,4).Value
report.Field5 = dataSheet.Cells(rowCount,5).Value
report.Field6 = dataSheet.Cells(rowCount,6).Value
report.Field7 = dataSheet.Cells(rowCount,7).Value
report.Field8 = dataSheet.Cells(rowCount,8).Value
report.Field9 = dataSheet.Cells(rowCount,9).Value
report.Field10 = dataSheet.Cells(rowCount,10).Value
report.Save True, False

NEMProgressSetBarPos hwnd, Clng(Int(rowCount*100/maxCount))

rowCount = rowCount + 1
Wend

' End Progress Bar
NEMProgressEnd hwnd

Exit Sub

errorhandle:
NEMProgressEnd hwnd


End Sub
« Letzte Änderung: 01.01.70 - 01:00:00 von 1034200800 »
Egal wie tief man die Messlatte für den menschlichen Verstand auch ansetzt: jeden Tag kommt jemand und marschiert erhobenen Hauptes drunter her!

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz