Well, from the docs and my testing, I don't *think* it'll work for an _olecontrol_ because you can only set DocumentFile in code when you create the object. The init happens too late. I know I tried somthing similar early on, and while I may have had a different problem altogether, I don't think it's legal.
What's odd to me is that I can
DEFINE CLASS oleexcelobject AS olecontrol
documentFile = GetFile()
...etc
but I couldn't do
DEFINE CLASS oleexcelobject AS olecontrol
documentFile = Get_File()
...etc
Oh, well, I ended up just adding a worksheet based on the template I want and (hokey) force the user to save it before going on.
>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
Précédent
Suivant
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