>I'd like to call my own GetFile wrapper (?) function, called Get_File() when I create my Excel OleControl object. I've tried a UDF in the PRG, and in a class method. I can call GETFILE() fine. I can assign the UDF return to a public variable in the prg, and set documentfile = myPublicVar.
>
>I don't want to use a public, but I will if I have to. Any suggestions?
>
>TIA
>
>DEFINE CLASS oleexcelObject as OLEControl
> oleTypeAllowed = 0
> OleClass ="excel.sheet.8"
> height = 170
> top = 0
> left = 0
> DocumentFile = GetFile() && This works, but file must exist
>*!* DocumentFile = this.getFile() && "Date type is invalid for this property."
> PROCEDURE get_file
> LOCAL cf
> cf = getFile('XLS')
> IF NOT FILE( cf )
> RETURN ""
> ENDIF
> RETURN cf
>ENDDEFINE
I there any reason not to call Get_File() from the init? This works:
DEFINE CLASS testO as line
DocumentFile = ""
PROCEDURE get_file
LOCAL cf
cf = getFile('XLS')
IF NOT FILE( cf )
RETURN ""
ENDIF
RETURN cf
endproc
procedure init
if !dodefault()
return .f.
endif
this.DocumentFile = this.Get_File()
endproc
ENDDEFINE
----------
Mark Bucciarelli