ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Problem with Auto Close module (https://www.excelbanter.com/excel-discussion-misc-queries/172518-problem-auto-close-module.html)

Kevin

Problem with Auto Close module
 
I have written code into a Workbook Open module.

Application.OnTime aTime2, Procedu="closeFile2"

the problem is, if I set it up to close after 1 minute but close it manually
before this time. It seems that after 1 minute even though the workbook is
close it executes above anyway and opens up the file again (and automatically
shuts it) - in a loop

I presume I am missing a lone of code that only executes above if the file
is open?

--
Kevin

Andy Pope

Problem with Auto Close module
 
Hi,

Have a read of Chip's page on OnTime
http://www.cpearson.com/excel/OnTime.aspx

Cheers
Andy

Kevin wrote:
I have written code into a Workbook Open module.

Application.OnTime aTime2, Procedu="closeFile2"

the problem is, if I set it up to close after 1 minute but close it manually
before this time. It seems that after 1 minute even though the workbook is
close it executes above anyway and opens up the file again (and automatically
shuts it) - in a loop

I presume I am missing a lone of code that only executes above if the file
is open?


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


All times are GMT +1. The time now is 10:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com