Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to save file 1

Status
Not open for further replies.

Rybrookar

Technical User
Jun 2, 2007
27
GB
Yesterday I posted this question and got answers to solve my problem but......


I've stopped working on the file and it still opens up (the file is closed) after the predetermined time (20 minutes)

I used :

application.ontime now + 20 minutes "myprocedure" (this is short hand for what I used.

Why does the file open up automatically after 20 minutes when it's closed and no longer in memory?

Any help appreciated
 





Code:
[b]application[/b].ontime now + 20 minutes "myprocedure"  (this is short hand for what I used.
As long as the Excel Application is open, this code will be running.

When you decide to STOP, execute...
Code:
application.ontime ""


Skip,
[sub]
[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue][/sub]
 
Skip

Thanks for that.

Can I write a code to stop this application when I close the workbook?

If so, how?

Thanks again.

 



call it from the Workbook_Close event.

Skip,
[sub]
[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue][/sub]
 
Sorry Skip.

I'm struggling with this. I can't find workbook_close event.

Where would it be?

 
I've used the following. Will it work?


Private Sub Workbook_BeforeClose(Cancel as Boolean)
application.ontime ""
End Sub

Thanks
 




Sorry, it is the BeforeClose event.

Skip,
[sub]
[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top