Solved

Application OnTime event

Posted on 2001-08-09
8
1,455 Views
Last Modified: 2007-11-27
Is the Application.OnTime event valid in Visual Basic? Or could be used only in VBA? I get the error message 'Macro "my_procedure" not found.' Even if I put the "my_procedure" in a different module, the error message is the same. Any solutions to this?
Thanks
0
Comment
Question by:octi
8 Comments
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6367206
When you put "my_procedure" in a different module you
must reference the module name of the different module:
"my_procedure" in a different module:

Application.OnTime Now + TimeValue("00:00:15"), "ModuleName.meine_Prozedur"

Best Regards
WoK
0
 
LVL 1

Accepted Solution

by:
kdg2000 earned 100 total points
ID: 6367207
In VB exists Timer Control. It fulfils the defined operations designated in Timer Evet through given time(milliseconds).

Usage:

At first it is necessary to place(install) time of operation, for example 10 milliseconds

me. Timer1. Interval=10

Further to start by its command

me. Timer1. Enabled=True

Through 10 milliseconds will be fulfilled Event Timer.
0
 
LVL 6

Expert Comment

by:Nitin Sontakke
ID: 6367209
Application is a generic object name, so its context changes according to its instantiation. Unless you are using automation, such an object doesn't exist in VB, forget the event.

So, make sure that Application object has appropriate context. You didn't mention from which Application did you imported the Macro.

If i am not clear, please give more info as what you are attempting to do. So that i will be able to tell more details.

But in short, Application.OnTime event is NOT in VB. It MIGHT be used, provided an appropriate context to Application object is available in VB.

Please give more details, though.
0
 

Author Comment

by:octi
ID: 6367230
Details:
I would like to run a procedure in Visual Basic (The result will be an exe file) at a certain time (8:00 AM for ex) using the Application objects OnTime event. This is the simplest one. The event occurs (becasuse I get the mentioned messege right on scheduled time) at the given time, but the procedure is not found.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6367278
Your procedure is defined in your VB exe project ?
0
 

Author Comment

by:octi
ID: 6367305
WolfgangKoenig>
Yes, my procedure is defined in the exe project.
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6367324
In your VB exe Project you have an handle to the VBA
application and then you call:

Application.ontime ....

Then VBA finds only VBA side defined macro procedures.
Not the functions defined in VB.

WoK

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6369104
I agree with WolfgangKoenig.
If you want to run code from VB (Not vba) at certain time, use, inside VB, a timer control or api's SetTimer and KillTimer.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 56
Excel - Save a copy of work book 13 82
Visual Studio search word table and return Cell index 8 48
Add and format columns in vb6 7 46
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now