#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default not use

I looking for code - if activeworkbook not use for 20
minutes then stuff ..

Please advise I would be very grateful.

Regards
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default not use

Hi Mark

Use a global Date variable and set it to Now on all sorts of events
(Worksheet_change, Worksheet_Selectionchange, Worksheet_Activate, ... ).
Then have a macro that for certain intervals checks if this variable is more
than 20 minutes old.

HTH. Best wishes Harald

"Mark" skrev i melding
...
I looking for code - if activeworkbook not use for 20
minutes then stuff ..

Please advise I would be very grateful.

Regards
Mark



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default not use

Hi Harald,

How will be in not used userform?
Coridially
Mark


-----Original Message-----
Hi Mark

Use a global Date variable and set it to Now on all sorts

of events
(Worksheet_change, Worksheet_Selectionchange,

Worksheet_Activate, ... ).
Then have a macro that for certain intervals checks if

this variable is more
than 20 minutes old.

HTH. Best wishes Harald

"Mark" skrev i melding
...
I looking for code - if activeworkbook not use for 20
minutes then stuff ..

Please advise I would be very grateful.

Regards
Mark



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default not use

I'm not sure I understand this question. But you have to define every single
event that qualifies for your "in use" definition and put some code there.

HTH. Best wishes Harald

"Mark" skrev i melding
...
Hi Harald,

How will be in not used userform?
Coridially
Mark


-----Original Message-----
Hi Mark

Use a global Date variable and set it to Now on all sorts

of events
(Worksheet_change, Worksheet_Selectionchange,

Worksheet_Activate, ... ).
Then have a macro that for certain intervals checks if

this variable is more
than 20 minutes old.

HTH. Best wishes Harald

"Mark" skrev i melding
...
I looking for code - if activeworkbook not use for 20
minutes then stuff ..

Please advise I would be very grateful.

Regards
Mark



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default not use

Hi Harald!
I not very smart in VBA, yet.
I write following code, not work good:

(in body workshhet)

Public dd as Date
Sub Worksheet_Change(ByVal Target As Range)
dd = Now
Application.OnTime dd + TimeValue("00:00:05"), "check"
End Sub

(in body module)
Public dd As Date
Sub check()

a = Now
If a - dd < 5 Then
MsgBox "sheet don't used for 5 sek. "
End If
End Sub

My variable dd isn't global why?
Msgbox still on...
I'd like check not used sheet for e.g 5 sek. and if not
used then show info and next check if not used 5 sek.
Please help!

Regards
Mark



-----Original Message-----
I'm not sure I understand this question. But you have to

define every single
event that qualifies for your "in use" definition and put

some code there.

HTH. Best wishes Harald

"Mark" skrev i melding
...
Hi Harald,

How will be in not used userform?
Coridially
Mark


-----Original Message-----
Hi Mark

Use a global Date variable and set it to Now on all

sorts
of events
(Worksheet_change, Worksheet_Selectionchange,

Worksheet_Activate, ... ).
Then have a macro that for certain intervals checks if

this variable is more
than 20 minutes old.

HTH. Best wishes Harald

"Mark" skrev i melding
...
I looking for code - if activeworkbook not use for 20
minutes then stuff ..

Please advise I would be very grateful.

Regards
Mark


.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"