Solved

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

Posted on 2006-06-13
2
235 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

791 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