>
Tmpsheet = GETOBJECT('','Excel.Sheet')
>
> XLApp = Tmpsheet.Application
>
> XLApp.Visible = .t.
> XLApp.WorkBooks.Add()
> XLSheet = XLApp.ActiveSheet
>
> Q1. Why it is creating 2 Excel files naming Book2 and Book4 how can i avoid 2 Excel files only open and save 1 Excel file from above commands
Tmpsheet = GETOBJECT('','Excel.Sheet') && This creates an Excel sheet
XLApp.WorkBooks.Add() && This creates an Excel workbook
So now you have 2 objects created. But this was already explained in another one of your posts. Why not just use
oEx = createobject("Excel.application")
oWB = oEx.WorkBooks.Add()
oEx.Visible = .t.
Mike Gagnon
Refox XI +(English version)