>>First problem: I have two database files and I want them copied into one .XLS file. I used a command of Copy to [filename] type XL5. But I got a problem, because when the second file was copied, the first file was overwritten. .. do you know how to solve it ?
>
>If the files are the same structure, then append one to the other and do a single COPY TO.... command. If they have different structures, and you want them on different pages of the spreadsheet, you may have to Import them from Excel instead of Exporting them from VFP
>
>>Second problem: I made an application using VFP 5.0, in the Main Menu program. I have closed all the databases but if I click the cross sign for quitting the program, a message will come out " Can not Quit Visual Fox Pro ". As I know, this message will come out only when someone tries to quit before closing all/some files.
>
>You probably have a table with open transactions. Check the DataSession window to see if you have open data sessions which should be rolled back, reverted, etc. until you can close them.
>
>HTH
if you really need to do it from VFP you could
ox=CREATEOBJECT("Excel.application")
ox.workbooks.ADD
select yourdatabase1
********************************************************
* A1.. Say Data
*
*******************************************************
STORE 0 TO m.rowlocation
LOCATE
********************************************************
*
* Output data for total inv
*
********************************************************
SCAN
STORE m.rowlocation+1 TO m.rowl
ox.cells[m.rowlocation,1].VALUE=yourdatabase1.field1
ox.cells[m.rowlocation,2].VALUE=yourdatabase1.field2
.....
ENDSCAN
select yourdatabase2
********************************************************
* ??.. Say Data
*
*******************************************************
LOCATE
********************************************************
*
* Output data from yourdatabase2
*
********************************************************
SCAN
STORE m.rowlocation+1 TO m.rowl
ox.cells[m.rowlocation,1].VALUE=yourdatabase2.field1
ox.cells[m.rowlocation,2].VALUE=yourdatabase2.field2
....
ENDSCAN
HTH
Jeff
It's Time to get a gun.
That's what I've been thinkin.
I think I can afford one, If I do a little less Drinkin.www.TrueGeeks.com