| You are here: DEVPPL ‹ Forum ‹ Programming ‹ Visual Basic Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
automatic close english
6 posts
• Page 1 of 1
0
automatic close english
hi every body i am new here and i have a question i work with excel so i want :
put a lebel on my workbook and when this work book is opend the label caption will be automaticly in minutes ( i mean the caption will be exemple : 5 minutes ) and when this 5 minutes in finished the workbook will be automaticly saved and closed .
so : the woorkbook will be automaticly saved and closed and elapsing time is appeared on this label
* so the time ( in minutes ) will be on the label caption .
and please could you give me an exemple .
please help me i need it.
put a lebel on my workbook and when this work book is opend the label caption will be automaticly in minutes ( i mean the caption will be exemple : 5 minutes ) and when this 5 minutes in finished the workbook will be automaticly saved and closed .
so : the woorkbook will be automaticly saved and closed and elapsing time is appeared on this label
* so the time ( in minutes ) will be on the label caption .
and please could you give me an exemple .
please help me i need it.
- Mohfa
- Reputation: 0
- Posts: 4
- Joined: Sun Dec 19, 2004 9:52 am
- Highscores: 0
- Arcade winning challenges: 0
0
well if you are using MS excel and asking for an option thaen i dont know
but if you want to create somthing like hat in vb then ya
surely i will try to help you
here it goes
just put a timer in yopur program and set the timer value to the no of miliseconds you want and then when the timer runs put the commands to save and close the window
i know the timer doesnt allow you to put a value above 3000
so in this case you set a timer value as a fraction of the time you want to close the window andincrement a variable every time the timer runs and check if the value mutiplied by the timer time and see if it >= the value you have set
that is it
in case you want the code then i can give it only tomorrow
just tell me if you program works
--DAFUNKYMUNKY
but if you want to create somthing like hat in vb then ya
surely i will try to help you
here it goes
just put a timer in yopur program and set the timer value to the no of miliseconds you want and then when the timer runs put the commands to save and close the window
i know the timer doesnt allow you to put a value above 3000
so in this case you set a timer value as a fraction of the time you want to close the window andincrement a variable every time the timer runs and check if the value mutiplied by the timer time and see if it >= the value you have set
that is it
in case you want the code then i can give it only tomorrow
just tell me if you program works
--DAFUNKYMUNKY
- Dafunkymunky
- Reputation: 0
- Posts: 183
- Joined: Fri Apr 08, 2005 8:32 am
- Location: India
- Highscores: 0
- Arcade winning challenges: 0
0
you could also use the windows clock if you just wanted to record the minutes, you could even make it start/end time if the clock is accurate and you want it on there. If you want the elapsed time, just look at the Now value, you probebly wouldnt need more than the hour and minute values (which are represented by Minute(Now) and Hour(Now) i believe). Then you simply take them when your form opens and save them to a variable, then when your done take another and find the difference.
- Fang Lunin
- Reputation: 0
- Posts: 9
- Joined: Fri May 13, 2005 9:49 am
- Highscores: 0
- Arcade winning challenges: 0
0
welcome to devppl fang lunin
why dont you put example codes also in your posts
why dont you put example codes also in your posts
--------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
- Dafunkymunky
- Reputation: 0
- Posts: 183
- Joined: Fri Apr 08, 2005 8:32 am
- Location: India
- Highscores: 0
- Arcade winning challenges: 0
0
ok, sorry about the delay as well
Heres an example of use of those functions in one way you can find the time, the time is in Military style so its on a 24 hour setting.
Private Sub Timer1_Timer()
If Hour(Now) <= 12 Then
lblTime.Caption = Hour(Now) & ":" & Minute(Now) & " AM"
ElseIf Hour(Now) > 12 Then
lblTime.Caption = (Hour(Now) - 12) & ":" & Minute(Now) & " PM"
End If
End Sub
Hope this helps
Heres an example of use of those functions in one way you can find the time, the time is in Military style so its on a 24 hour setting.
Private Sub Timer1_Timer()
If Hour(Now) <= 12 Then
lblTime.Caption = Hour(Now) & ":" & Minute(Now) & " AM"
ElseIf Hour(Now) > 12 Then
lblTime.Caption = (Hour(Now) - 12) & ":" & Minute(Now) & " PM"
End If
End Sub
Hope this helps
- Fang Lunin
- Reputation: 0
- Posts: 9
- Joined: Fri May 13, 2005 9:49 am
- Highscores: 0
- Arcade winning challenges: 0
0
Hmmm you can do it this way but i feel a timer would be a simpler than to display the current time and so on
--------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
- Dafunkymunky
- Reputation: 0
- Posts: 183
- Joined: Fri Apr 08, 2005 8:32 am
- Location: India
- Highscores: 0
- Arcade winning challenges: 0
|
|