Results 1 to 17 of 17

Thread: Create User Control Object at runtime Without form

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2020
    Posts
    16

    Post Create User Control Object at runtime Without form

    Hi, I'm trying to load a user control at runtime. I am not using any form, everything will be done using a Module and classes.

    I can do this if I have an ActiveX control or reference, but can't seem to figure out how to do this with a user control


    The Below works fine, but I need to also have ShellPipe.ctl loaded as I will be running commands via cmd at set intervals.

    Code:
    Dim TimerAutomate As ccrpCountdown
    Set TimerAutomate = New ccrpCountdown
    
    TimerAutomate.Duration = 10000
    TimerAutomate.Enabled = True
    
    Do
    Doevents
    Loop While TimerAutomate.Enabled = True
    
    msgbox "Timer has finished counting down"
    Thanks in advance


    Update: I managed to Declare ShellPipeMain as ShellPipe, and in my Class, set Public WithEvents ShellPipeMain As ShellPipe

    Class:
    Code:
    Public WithEvents TimerAutomate As ccrpTimers6.ccrpCountdown
    Public WithEvents ShellPipeMain As ShellPipe
    Module:
    Code:
    Public ShellPipeMain As ShellPipe
    Not I get an error: Object variable or With block variable not set

    Is there something else I need to do/declare?
    Last edited by Maddis; Sep 30th, 2023 at 03:08 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width