{"id":14660,"date":"2018-03-22T22:10:46","date_gmt":"2018-03-22T22:10:46","guid":{"rendered":"http:\/\/learnexcelmacro.com\/wp\/?p=14660"},"modified":"2018-03-23T09:35:57","modified_gmt":"2018-03-23T09:35:57","slug":"what-is-application-ontime-method-and-its-usage-in-excel-vba","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/","title":{"rendered":"Schedule to close Workbook using Application.OnTime"},"content":{"rendered":"

Dear Friends,<\/p>\n

In this article I am going to teach you about Application.OnTime. <\/strong> I will also explain you the usage of this method with two examples:<\/p>\n

\nHow to schedule a workbook to close at specified time
\nHow to Schedule a workbook to close if left idle for specified duration\n<\/div>\n

This method is used to execute a procedure in Excel VBA at a specific time or after certain time has elapsed.
\nLets have a look at the syntax of this Excel VBA method:<\/p>\n

Syntax:<\/h2>\n

Application.OnTime( EarliestTime , Procedure , LatestTime , Schedule )<\/em><\/strong><\/p>\n

Where:<\/h3>\n

EarliestTime: <\/strong> This is a mandatory parameter and this is the time when you want to run your procedure. It accepts a variant data type.
\nProcedure: <\/strong> This is also a mandatory parameter. It is the name of the procedure\/macro you want to run. It is a string type parameter.
\nLatestTime :<\/strong> This is an optional parameter. This is a maximum waiting time set by programmer for Excel to complete any ongoing activity like Cut, Copy, Paste, Save etc. and then start this procedure. Note that, if other ongoing activities are not complete within the specified waiting time then the procedure will not run. Since this is an optional parameter, if omitted, Application.OnTime method will wait till excel does not finish all its activities.<\/strong>
\nSchedule :<\/strong> This is an optional parameter. This is a boolean type parameter. True<\/strong> is used to schedule new procedure. False<\/strong> is used to clear out previously scheduled procedure.<\/p>\n

Example 1# Schedule to save and close workbook<\/h1>\n

Follow the below steps to achieve this:<\/p>\n

Step 1#<\/h2>\n

Copy and paste the following code in your ThisWorkbook<\/em> <\/span> Code window<\/p>\n

\r\n\r\nPrivate Sub Workbook_Open()\r\n    On Error Resume Next\r\n    ' Schedule the Save&CloseWorkbook procedure at 5:30 PM\r\n    Application.OnTime VBA.TimeValue(\"17:30:00\"), \"SaveAndCloseWorkBook\", , True\r\nEnd Sub\r\n\r\nPrivate Sub Workbook_BeforeClose(Cancel As Boolean)\r\n    On Error Resume Next\r\n    'Before closing the workbook, remove the schedule\r\n    Application.OnTime VBA.TimeValue(\"17:30:00\"), \"SaveAndCloseWorkBook\", , False\r\n    On Error GoTo 0\r\nEnd Sub\r\n<\/code>\r\n<\/pre>\n

Step 2#<\/h2>\n

Last but not the least step, copy paste the Save and Close workbook function which will be triggered at scheduled time in any of the regular module in your VBE project.<\/p>\n

\r\n\r\nSub SaveAndCloseWorkBook()\r\n    ThisWorkbook.Close SaveChanges:=True\r\nEnd Sub\r\n<\/code>\r\n<\/pre>\n

Example 2# Save and Close workbook, if left idle<\/h1>\n

Before we proceed further, let see – How to check if excel was left idle?<\/span>
\nHere I am checking following two events to determine if excel was left idle-
\nSelectionChange in Workbook Event
\nAny Change across workbook Event<\/p>\n

If any of the above events are happening with workbook, idle duration will be reset back to zero again.<\/p>\n

\n

What is use of this? <\/h3>\n

This is very useful when a workbook is shared to be used by more than one user. Incase any user left the excel open after working then, it will not be availbale for other users until he himself logs in and close the excel.
\nIn such case, this little macro will help. It will automatically save and close the workbook if it was left idle for certain time (you can configure whatever you wish to)\n<\/p><\/div>\n

Step 1#<\/h2>\n

Copy and paste the following code in any module in your VBE Project. Read basic tutorials – how to add modules in VBE.
\nNote that the following 2 lines must be added at the top of the module. It should not be pasted after any function\/procedure in the module.<\/p>\n

\r\n\r\nPublic runTime As Double\r\nPublic Const DURATION_IN_HOURS = 0\r\nPublic Const DURATION_IN_MINUTES = 30\r\nPublic Const DURATION_IN_SECONDS = 0\r\n<\/code>\r\n<\/pre>\n

You can use this duration according to your need. In this function I have used it for 30 minutes.<\/p>\n

Step 2#<\/h2>\n

Copy and paste the following code in your ThisWorkbook<\/em> <\/span>Code Window. <\/p>\n

\r\n\r\nPrivate Sub Workbook_Open()\r\n    On Error Resume Next\r\n    ' Set the runTime public varibale with the specified duration\r\n    ' To change the time you can change in the public Constants\r\n    ' defined in one of your module\r\n    runTime = Now + TimeSerial(DURATION_IN_HOURS, DURATION_IN_MINUTES, DURATION_IN_SECONDS)\r\n    \r\n    ' Now schedule the Save&CloseWorkbook procedure with the specified duration\r\n    Application.OnTime runTime, \"SaveAndCloseWorkBook\", , True\r\nEnd Sub\r\n\r\nPrivate Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)\r\n\r\nOn Error Resume Next\r\n    ' As explained above to reset the scheduled time for this save and close procedure\r\n    ' Scheduled - False parameter is used\r\n    Application.OnTime runTime, \"SaveAndCloseWorkBook\", , False\r\n    \r\n    ' Now reset the runTime variable again based on the new time\r\n    runTime = Now + TimeSerial(DURATION_IN_HOURS, DURATION_IN_MINUTES, DURATION_IN_SECONDS)\r\n    \r\n    'Now re-schedule the Save&Close function with the new calculated time.\r\n    Application.OnTime runTime, \"SaveAndCloseWorkBook\", , True\r\nEnd Sub\r\n\r\nPrivate Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)\r\nOn Error Resume Next\r\n    ' As explained above to reset the scheduled time for this save and close procedure\r\n    ' Scheduled - False parameter is used\r\n    Application.OnTime runTime, \"SaveAndCloseWorkBook\", , False\r\n    \r\n    ' Now reset the runTime variable again based on the new time\r\n    runTime = Now + TimeSerial(DURATION_IN_HOURS, DURATION_IN_MINUTES, DURATION_IN_SECONDS)\r\n    \r\n    'Now re-schedule the Save&Close function with the new calculated time.\r\n    Application.OnTime runTime, \"SaveAndCloseWorkBook\", , True\r\nEnd Sub\r\n\r\nPrivate Sub Workbook_BeforeClose(Cancel As Boolean)\r\n    On Error Resume Next\r\n    \r\n    'Before closing the workbook, remove the schedule\r\n    Application.OnTime RunWhen, \"SaveAndCloseWorkBook\", , False\r\n    On Error GoTo 0\r\nEnd Sub\r\n<\/code>\r\n<\/pre>\n

Step 3#<\/h2>\n

Last but not the least step – write your own procedure which you want to schedule it. Make sure that the name of the procedure exactly same as you have provided in the Application.OnTime method in above code.<\/p>\n

Now Paste this SaveAndCloseWorkbook function code any where in any of the regular Modules (not in worksheet or workbook module)<\/p>\n

\r\n\r\nSub SaveAndCloseWorkBook()\r\n    ThisWorkbook.Close SaveChanges:=True\r\nEnd Sub\r\n<\/code>\r\n<\/pre>\n
\n

Important:<\/h2>\n

Here I have provided only two basic usage of this function. You can use it even for triggering any of your procedure to run at specific interval etc.
\nIf you find any other interesting usage of this method, do not forget to share it with every one by commenting to this article.\n<\/p><\/div>\n<\/span>","protected":false},"excerpt":{"rendered":"

Dear Friends, In this article I am going to teach you about Application.OnTime. I will also explain you the usage of this method with two examples: How to schedule a workbook to close at specified time How to Schedule a workbook to close if left idle for specified duration This method is used to execute […]<\/p>\n","protected":false},"author":45,"featured_media":14681,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1246,1674,1679],"tags":[],"class_list":["post-14660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-macro","category-excel-macro-basics","category-excel-macro-beginner"],"yoast_head":"\nSchedule to close Workbook using Application.OnTime - Let's excel in Excel<\/title>\n<meta name=\"description\" content=\"What is Application.OnTime Method in Excel VBA? Usage of Application.OnTime method in Excel VBA. How to schedule to close a workbook at a specific time. Schedule to close a workbook if a workbook left idle for specific duration. Schedule a function in your Excel Workbook using Application.OnTime Method. How to use Application.OnTime Method.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Schedule to close Workbook using Application.OnTime\" \/>\n<meta property=\"og:description\" content=\"What is Application.OnTime Method in Excel VBA? Usage of Application.OnTime method in Excel VBA. How to schedule to close a workbook at a specific time. Schedule to close a workbook if a workbook left idle for specific duration. Schedule a function in your Excel Workbook using Application.OnTime Method. How to use Application.OnTime Method.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-22T22:10:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-23T09:35:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"538\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Schedule to close Workbook using Application.OnTime\",\"datePublished\":\"2018-03-22T22:10:46+00:00\",\"dateModified\":\"2018-03-23T09:35:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/\"},\"wordCount\":645,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg\",\"articleSection\":[\"Excel Macro\",\"Excel Macro Basics\",\"Excel Macro Beginner\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/\",\"name\":\"Schedule to close Workbook using Application.OnTime - Let's excel in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg\",\"datePublished\":\"2018-03-22T22:10:46+00:00\",\"dateModified\":\"2018-03-23T09:35:57+00:00\",\"description\":\"What is Application.OnTime Method in Excel VBA? Usage of Application.OnTime method in Excel VBA. How to schedule to close a workbook at a specific time. Schedule to close a workbook if a workbook left idle for specific duration. Schedule a function in your Excel Workbook using Application.OnTime Method. How to use Application.OnTime Method.\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg\",\"width\":800,\"height\":538},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Macro\",\"item\":\"https:\/\/vmlogger.com\/excel\/macro\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Schedule to close Workbook using Application.OnTime\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Schedule to close Workbook using Application.OnTime - Let's excel in Excel","description":"What is Application.OnTime Method in Excel VBA? Usage of Application.OnTime method in Excel VBA. How to schedule to close a workbook at a specific time. Schedule to close a workbook if a workbook left idle for specific duration. Schedule a function in your Excel Workbook using Application.OnTime Method. How to use Application.OnTime Method.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/","og_locale":"en_US","og_type":"article","og_title":"Schedule to close Workbook using Application.OnTime","og_description":"What is Application.OnTime Method in Excel VBA? Usage of Application.OnTime method in Excel VBA. How to schedule to close a workbook at a specific time. Schedule to close a workbook if a workbook left idle for specific duration. Schedule a function in your Excel Workbook using Application.OnTime Method. How to use Application.OnTime Method.","og_url":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2018-03-22T22:10:46+00:00","article_modified_time":"2018-03-23T09:35:57+00:00","og_image":[{"width":800,"height":538,"url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg","type":"image\/jpeg"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Schedule to close Workbook using Application.OnTime","datePublished":"2018-03-22T22:10:46+00:00","dateModified":"2018-03-23T09:35:57+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/"},"wordCount":645,"commentCount":0,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg","articleSection":["Excel Macro","Excel Macro Basics","Excel Macro Beginner"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/","url":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/","name":"Schedule to close Workbook using Application.OnTime - Let's excel in Excel","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg","datePublished":"2018-03-22T22:10:46+00:00","dateModified":"2018-03-23T09:35:57+00:00","description":"What is Application.OnTime Method in Excel VBA? Usage of Application.OnTime method in Excel VBA. How to schedule to close a workbook at a specific time. Schedule to close a workbook if a workbook left idle for specific duration. Schedule a function in your Excel Workbook using Application.OnTime Method. How to use Application.OnTime Method.","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#primaryimage","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2018\/03\/ScheduleWorkbook-Close.jpg","width":800,"height":538},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2018\/03\/what-is-application-ontime-method-and-its-usage-in-excel-vba\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Macro","item":"https:\/\/vmlogger.com\/excel\/macro\/"},{"@type":"ListItem","position":3,"name":"Schedule to close Workbook using Application.OnTime"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/14660"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=14660"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/14660\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media\/14681"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=14660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=14660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=14660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}