Bonjour,
En créant une instance de OWC.Spreadsheet tu pourras piloter un Excel dans une form Windows :)
Voici un exemple tout bête qui ouvre un OWC Excel ( écrit en FBSL ) :
#DllDeclare ATL( "AtlAxWinInit", "AtlAxGetControl" )
Dim %Lefti, %Topi, %Righti, %Bottomi, %XL, %hWnd
Sub Command1_Click()
PostMessage( Me, WM_SIZE, 0, 0 ): Show(Me)
End Sub
Sub Form_Load()
Dim $WinName
AtlAxWinInit()
WinName = "OWC.Spreadsheet"
hWnd = FBSL_Control("AtlAxWin", Me, WinName, _
0, 0, 15, 620, 460, WS_CHILD Bor WS_VISIBLE, 0)
AtlAxGetControl( hWnd, @XL )
End Sub
Sub RefreshAfxControl()
GetClientRect( Me, Lefti, Topi, Righti, Bottomi )
ReSize(hWnd, 0, 30, Righti - 15, Bottomi - 60)
Refresh(hWnd)
End Sub
Sub QuitMe()
ReleaseObject( XL ): ExitProgram(0)
End Sub
Sub Main()
Resize(Me, 0, 0, 640, 480 )
Center(Me)
Form_Load()
Command1_Click()
Begin Events
If CBMsg = WM_CLOSE Then QuitMe()
If CBMSG = WM_SIZE Then RefreshAfxControl()
End Events
End Sub
Gérôme GUILLEMIN
Auteur du langage FBSL