Solved

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

Posted on 2006-06-13
2
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

687 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