Need help in sending excel through mail

Hi allI am trying to create an excel report and sending it to through mail.

How can i attach it to mail.

i tried following code,but it is not working

can you tell where i am wrong?

' REM temporary location to save the Excel file

OutputFile = "d:\scripts\excel\file1.xls"

'Excel Creation	

Dim Excel As Variant	

Dim xlWorkbook As Variant	

Dim xlSheet As Variant	

Set Excel = CreateObject( "Excel.Application" )	

Excel.Visible = False	

Excel.Workbooks.Add	

Set xlWorkbook = Excel.ActiveWorkbook	

Set xlsheet = Excel.Workbooks(1).Worksheets(1) 	

Excel.Windows(1).DisplayGridlines=True	

Excel.ScreenUpdating = False	

Excel.Calculation = -4135 

row=1	

With xlsheet		

	.Cells(row, 1).Value = "Your action/request"		

	.Cells(row, 2).Value = "See below!"		

	.Cells(row, 3).Value = "Your comment"		

	.Cells(row, 4).Value = "Document Holder"		

	.Cells(row, 5).Value = "DocNo"		

	.Cells(row, 6).Value = "DocTitle"		

	.Cells(row, 7).Value = "CustomerStatus"		

	.Cells(row, 8).Value = "Open since"		

	.Cells(row, 9).Value = "Last update"		

	.Cells(row, 10).Value = "Status"		

	.Cells(row, 11).Value = "Company"		

	.Cells(row, 12).Value = "BPFuture"

	.Cells(row, 13).Value = "ProductCodeNo"		

	.Cells(row, 14).Value = "ProductDescription"		

	.Cells(row, 15).Value = "BusinessAreaNo"		

	.Cells(row, 16).Value = "ProductCentreNo"

End With





For i=1 To Ubound(DocHolder)

	

	With xlsheet		

		.Cells(row+i, 4).Value = DocHolder(i)

		.Cells(row+i, 5).Value = DocNo(i)

		.Cells(row+i, 6).Value = DocTitle(i)

	End With

Next



Call Excel.Save(OutputFile)

Excel.Application.Quit

Set Excel = Nothing



'So now excel is ready



Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim rtitem As NotesRichTextItem

Dim object As NotesEmbeddedObject

Set db = session.CurrentDatabase

Set doc = New NotesDocument( db )

Set rtitem = New NotesRichTextItem(doc, "Body" )

Set object = rtitem.EmbedObject (1454, "","OutputFile","Quarterly Report" )

Call doc.Send(0,"mailID")

End Sub

Subject: need help in sending excel through mail

I suspect your problem is that in the line set object = … at the end you specify “OutputFile” as a string in quotes, whereas it should be a variable without the quotes

Subject: RE: need help in sending excel through mail

yes you are correct.now it is working…But while running agent it is showing save as window…

Is it possible to send without saving an excel in our system?

Subject: RE: need help in sending excel through mail

Well, you have to save it to attach it, but you get around the prompt coming up by setting the saved property of the excel application to true, I think it’s xlapp.issaved = true, but you might want to check that