Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Joel,
Here is some quick code that will show one way to do it using the clipboard. You could also insert values directly into cells.
Gary
LOCAL oExcel
oExcel = NULL
USE MyTable
_vfp.DataToClip('MyTable',RECCOUNT('MyTable'), 3)
oExcel = CREATEOBJECT('Excel.Application')
IF !ISNULL(oExcel)
oExcel.Workbooks.Add
oExcel.ActiveSheet.RANGE('A1').SELECT
oExcel.ActiveSheet.Paste()
oExcel.visible = .T.
oExcel.ActiveSheet.RANGE('A1').SELECT
*-- Windows API call to set the top window
DECLARE integer BringWindowToTop IN WIN32API integer
BringWindowToTop(oExcel.Hwnd)
ENDIF
>How do I send a table to Excel?
>
>I know I just:
>Use MyTable
>Copy to MyTableExcel type xls
>
>But I want to open Excel and have it displaying MyTableExcel
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement