?
Solved

Import a excel worksheet

Posted on 2003-02-24
9
Medium Priority
?
189 Views
Last Modified: 2013-12-18
I am trying to import an excel file into the body of an automated mail, currently I am saving the excel file as a text file and importing line by line(see below), is their anyway of importing directly from excel?

thanks,
chawks

Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
FileNum = Freefile()
FileName = "C:\latest Stock Prices.txt"
     
Open FileName For Input As FileNum
     
          Do While Not Eof(FileNum)
          Line Input #fileNum, oneLine
          Call rtitem.AppendText( oneLine )
          Call rtitem.AddNewLine( 1 )
          oneLine = "" 
     Loop
     Close FileNum
     doc.Form = "Memo"
0
Comment
Question by:chawks
[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
  • 2
  • +1
9 Comments
 
LVL 7

Expert Comment

by:scottrma
ID: 8011807
You could try selecting everything in the Excel spreadsheet and then putting the cursor in the Body field of the Memo and hitting Paste, or Paste Special, if that is available. I am not sure if the formatting would get messed up though, but it's worth a try.

Regards,

Scott
0
 

Author Comment

by:chawks
ID: 8015125
I am trying to automate this procees through an agent, pulling directly from a excel file, basically I am looking for the code which will automate impoting the file into a memo
0
 
LVL 1

Expert Comment

by:bjohns33
ID: 8026583
You can do this through OLE, but you would need to have Excel installed on the server, which isn't elegant or recommended.

Is attaching the Excel file instead of importing the data an option?

If not, where and when is the Excel file created?  If it's created by a user with a Notes client on their machine (even if they haven't, there is a way to remotely invoke it from another machine with COM, but that get's messy!)then you could automate the process from within Excel with some fairly simple VBA.

Answers to the above and I'm sure we can come up with a solution!

Regards
Ben
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:chawks
ID: 8026794
Automating it from excel would be ideal, would you have any idea how to invoke it with VBA,

thanks
0
 
LVL 1

Accepted Solution

by:
bjohns33 earned 200 total points
ID: 8026991
Very simple example using COM (if you have any problems with this, you can revert to OLE, using Notes.NotesSession as the object):

Dim session As NotesSession
Set session = CreateObject("Lotus.NotesSession")
Call session.Initialize()


The subject 'Accessing the Domino Objects through COM' in the Domino Designer help, surprisingly :), gives a lot of reasonable examples to get you going, and a detailed discussion of the differences between the languages.

If you get stuck at all, let me know and I'll work through it with you.

Cheers
Ben
0
 

Expert Comment

by:simpsop
ID: 8028651
Not sure if this would work, but I use Simply Notes Import from http://www.simply-notes.com/ for importing Excel data. Have not tried in an email though. Setup a profile & run with it, very easy.
0
 

Expert Comment

by:simpsop
ID: 12232440
TheLearnedOne,
  I agree with your decision. Points to bjohns33.
-Paul
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

777 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