View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
rci rci is offline
external usenet poster
 
Posts: 40
Default OnTime no workie in Userform


Hi Tom,

thanks.... but the problem is the same... here is the code involved:


the DammitButton in inside Frame1 on the userform "S2pViewer" -



Private Sub DirListBox_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

DammitButton.Visible = True
Application.OnTime Now + TimeValue("0:0:4"), "S2pViewer.DammitClear"

End Sub

Public Sub DammitClear()
DammitButton.Visible = False
End Sub



The error message is that the macro S2pViewer.DammitClear cannot be found.


Excel 2002


Thx,

MP





Tom Ogilvy wrote:
: You probably just need to make the procedure in the Userform that you want
: Ontime to call to be public.

: Public Sub ProcedureName()

: End Sub

: then perhaps call it with

: Application.Ontime Now + Timevalue("0:0:15"), "Userform1.ProcedureName"

: Where userform1 would be the name of the userform.

: --
: Regards,
: Tom Ogilvy

: "rci" wrote in message
: ...
:
: Hi all...
:
: the OnTime function does not work inside userform code... in the sense
: that
: the sub that it calls can't be run in the Userform code.
:
: The reason why I need to have it work otherwise, or to find an
: alternative,
: is that I need to cause a button (on a userform) to become invisible after
: a few
: seconds (while not impairing normal program funciton in the meantime).
:
: I can cause OnTime to launch a sub in standard module code... but userform
: objects are apparently invisible to code running there.
:
: Suggestions?
:
: Thanks all!
:
: MP