>you wrote...
>
>> I use OLE Automation - open the template, save it to a new name and then walk > through the cursor putting the data into the template.
>
>I think I can open the template using OLE Automation, but what are the commands
>I have to use to '...walk through the cursor putting the data into the template' / if I do not use a macro in Excel, I mean all the code in VFP side ?
Would the following help get you started?
local lcXLFile, ox
lcXLFile = getfile("Excel Files:XLS")
if empty(lcXLFile)
return .f.
endif
use MyTable
ox=createobject("excel.application")
ox.Workbooks.Open(lcXLFile)
for i = 1 to reccount('MyTable')
with ox.sheets(1)
.cells(i,1).value = MyTable.Field1
.cells(i,2).value = MyTable.Field2
.cells(i,3).value = MyTable.Field3
.cells(i,4).value = MyTable.Field4
endwith
skip
next
ox.quit
Mark McCasland
Midlothian, TX USA