You are here: DEVPPL Forum Programming Visual Basic Forum
NOTIFICATIONS
54.068
MEMBERS
15.678
TOPICS
62.243
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

automatic close english

0

Loading

automatic close english

Postby Mohfa » Sun Dec 19, 2004 11:25 am

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.
Mohfa
 
Reputation: 0
Posts: 4
Joined: Sun Dec 19, 2004 9:52 am
Highscores: 0
Arcade winning challenges: 0

automatic close english - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Postby Dafunkymunky » Mon Apr 25, 2005 8:53 am

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
Dafunkymunky
 
Reputation: 0
Posts: 183
Joined: Fri Apr 08, 2005 8:32 am
Location: India
Highscores: 0
Arcade winning challenges: 0
0

Loading

Postby Fang Lunin » Fri May 13, 2005 10:52 am

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

Loading

Postby Dafunkymunky » Fri May 13, 2005 2:57 pm

welcome to devppl fang lunin

why dont you put example codes also in your posts
--------DAFUNKYMUNKY--------
::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

Loading

Postby Fang Lunin » Mon Jun 06, 2005 3:24 am

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
Fang Lunin
 
Reputation: 0
Posts: 9
Joined: Fri May 13, 2005 9:49 am
Highscores: 0
Arcade winning challenges: 0
0

Loading

Postby Dafunkymunky » Tue Jun 07, 2005 9:29 am

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....
Dafunkymunky
 
Reputation: 0
Posts: 183
Joined: Fri Apr 08, 2005 8:32 am
Location: India
Highscores: 0
Arcade winning challenges: 0
^ Back to Top