Thank you. This is what I just tried (extract from xHarbour's win32ole.prg), but unfortunately it doesn't work:Richard Chidiak wrote:Enrico
OleDefaultArg()
is a shortcut to:
VTWrapper( VT_ERROR, DISP_E_PARAMNOTFOUND )
Code: Select all
FUNCTION MAIN()
LOCAL oExcel := CREATEOBJECT( "Excel.Application" )
LOCAL cXls := "e:\xharbour\test.xls"
oExcel:WorkBooks:Open( cXls, , , OLEDEFAULTARG(), , , , OLEDEFAULTARG(), , , .T., , .T. )
oExcel:Visible = .T.
RETURN NIL
#define VT_ERROR 10
#define DISP_E_PARAMNOTFOUND 0x80020004
FUNCTION OLEDEFAULTARG()
RETURN VTWRAPPER( VT_ERROR, DISP_E_PARAMNOTFOUND )
#include "Hbclass.ch"
CLASS VTWrapper
DATA vt
DATA Value
METHOD New( vt, xVal ) CONSTRUCTOR
ENDCLASS
METHOD New( vt, xVal ) CLASS VTWrapper
::vt := vt
::Value := xVal
RETURN Self
EMGError WINOLE/1007 Impossibile trovare la proprieta Open per la classe Workbooks. (0x800A03EC): Microsoft Excel (DOS Error -2147352567)
Called from TOLEAUTO:OPEN(0)
Called from MAIN(7)