I have a Visual Basic 6.0 application, it contains a form with onload event, and a Timer.

When I run the application as a scheduled task (Run as: Administrator, Run: At system startup) it executes the onload event, but it will not start the Timer.

If I run the application manually when I log onto the Windows 2003 server it executes fine.

The application will not even give me any errors; it just will not start the Timer.
I have also tried to add “Me.Timer1.Enabled=True” in the onload event, but still same problem.

Change your code to start the application from SUB_MAIN in stead of ONLOAD event.

As Debasisdas said, open a sub main procedure -

Public Sub Main ()

Load Form1
Form1.Show

End Sub

This will be in a module within your application.

In your Form1>load event you will have -

Timer1.Enabled = True

I hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.