Solved

creating an excel spreadsheet based on the output result of a loop

Posted on 2006-06-13
2
232 Views
Last Modified: 2013-12-18
Hi all,

This may be a strange question.

Is it possible to create an excel spreadsheet then email that spreadsheet to specific users based on results of a script.

For example, if I have the following example, and this is just an example:

Sub Click(Source As Button)
      
   ' === Get the location of the course DBs
      Dim session As New NotesSession
      Dim dbCur As NotesDatabase
      Set dbCur = session.CurrentDatabase
      Dim sPath As String
      spath = Left( dbCur.FilePath, Len(dbCur.FilePath) - Len(dbCur.FileName) )
      
     ' === Access the Parts database
      Dim dbParts As New NotesDatabase( "", spath & "5LS2part.nsf" )
      
      ' === Set the database search criteria
      Dim sSearchCriteria As String
      sSearchCriteria = | Sex = "Ladies" & @Left(PartID;2) = "GS" |
      
      ' === Gather the collection of ladies parts
      Dim collLadiesParts As NotesDocumentCollection
      Set collLadiesParts = dbParts.Search(sSearchCriteria, Nothing , 0 )
      
      ' === Declare the loop variables
      Dim sGolfSets As String
      Dim docPart As notesdocument
      
      ' === Walk the collection and build the text output of golf sets
      Set docPart = collLadiesParts.GetFirstDocument
      Do Until docPart Is Nothing
            sGolfSets = sGolfSets & Format(docPart.PartPrice(0),"currency")      &  " - "  & docPart.PartName(0) &  Chr(13)
            Set docPart = collLadiesParts.GetNextDocument(docPart)
      Loop
      
      ' === Report the ladies golf sets
Messagebox sGolfSets, MB_ICONINFORMATION , "Big Oak Ladies Golf Sets"
      
 
HERE MY QUESTION

Instead of the messagebox, can I create a spreadsheet from based on the output variable(sGolfSets) and can I then append this spreadsheet as a link and send it in an email to a specific user?

Any help will be much appreciated.

      
0
Comment
Question by:varvoura
  • 2
2 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 16893018
It would be easier to creaate a CSV file that will open in EXCEL.
You could create the excel spreadsheet, but you may have difficulty saving it automatically, before sending it.

I will find you some samples

0
 
LVL 63

Accepted Solution

by:
SysExpert earned 500 total points
ID: 16893034
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now