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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only