-
2
- #1
I use this code when I want to copy a cursor or table over to Excel so I can easily sort it or otherwise mess with it.
Local lcFile
lcFile = 'c:\temp\export.xls'
COPY TO &lcFile TYPE XL5
oExcel = CREATEOBJECT('Excel.Application')
oExcel.Visible = .T.
if !file(lcFile)
=MESSAGEBOX(lcfile + ' not found!')
return
endif
oExcel.Application.Workbooks.Open(lcFile)
WAIT WINDOW "Click the VFP window to finish."
oExcel.Workbooks.Close
oExcel.Quit
Release oExcel
Local lcFile
lcFile = 'c:\temp\export.xls'
COPY TO &lcFile TYPE XL5
oExcel = CREATEOBJECT('Excel.Application')
oExcel.Visible = .T.
if !file(lcFile)
=MESSAGEBOX(lcfile + ' not found!')
return
endif
oExcel.Application.Workbooks.Open(lcFile)
WAIT WINDOW "Click the VFP window to finish."
oExcel.Workbooks.Close
oExcel.Quit
Release oExcel