Excel Sheet modification

Hello,

I have an excel sheet, already some data is there in that excel sheet. Now in one column I have to write the data.

For that I have written below code. But when I am opening excel file it is opening other excel as Book2 there it is showing the data in that column, but it is not updating in the actual excel sheet.Please help me out regarding this.

Sub Click(Source As Button)

Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim view As NotesView

Dim row As Integer

Dim written As Integer



Set db = session.CurrentDatabase

Set doc = New NotesDocument(db)

Set db=session.currentdatabase

Set doc = New NotesDocument(db)



FileName="V:\satyaveni\Copy of BAU Actitivites - Sample Template"

Set xlApp = CreateObject("Excel.application")

xlApp.Visible = False



xlApp.Workbooks.Add

'xlApp.Workbooks(1).Worksheets.Add ,,1



'Set xlsheet = xlApp.Workbooks(1).Worksheets(1)

Set xlWorkbook = xlApp.ActiveWorkbook

Set xlSheet = xlWorkbook.ActiveSheet

'xlsheet.Name = "BAU Directory"





Goto Records

Records:

row = 1 '// These integers intialize to zero anyway

written = 0



Print "Starting import from Excel file..."



Do While True '// We use a test a few lines down to exit the loop

Finish:

	With xlSheet

		row = row + 1

		

		xlSheet.Cells(row,15).Value = "Done"

		

		

		'Msgbox"mailid" &mailid

		If row=7 Then

			Exit Sub

		End If

		

		'Call mailsend(system,matter,mailid)

		written = written + 1

		

	End With

	

	Print written & " records imported...", doc.LastName(0)

Loop

	



xlWorkbook.SaveAs xlFilename

xlWorkbook.Close False

Excel.Quit

Set Excel = Nothing

'Return

End Sub

Subject: Excel Sheet modification

Hi Veni!

I think you would like to open saved file and want some amendment in that file. if i m right then try this code.

Replace: xlApp.Workbooks.Add → xlApp.Workbooks.Add(FileName)

Thanks

Dee

Subject: Excel Sheet modification

Hi,

I have tried the above method. Still another excel one it is creating . Instead of Saveas I have tried save also but no use.