Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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