Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 9th, 2004, 09:54 AM
Authorized User
Join Date: May 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default code to force xls file to open after several hours

Hi All

i am tring to write a code to force xls file open by it self when several hours (any number of hours, say 3 hours) has passed..

either pased on a condition Like A1=Now() so when 3 hours paased then, or
based on the computer time so after 3 hours passed then

my try was as follwing (placed in workbook_open) or somewhere else

If A1
getopenfile( file path)
end if

any help is appreciated in advanced

Old June 16th, 2004, 02:42 AM
Authorized User
Join Date: Jun 2004
Location: Darmstadt, , Germany.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts

Running the following subroutine will cause Excel to run the subroutine called "openFile" after 3 hours.

Sub openInThreeHours()
  dtScheduledTime = Now + TimeSerial(3,0,0)
  Application.OnTime dtScheduledTime, "openFile"
End Sub

Hope that helps.

Ne auderis delere orbem rigidum meum!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! how to read the file of *.xls hussar91404 C# 4 April 25th, 2014 03:41 AM
Reading xls file balesh.mind ASP.NET 2.0 Professional 1 August 27th, 2007 11:54 PM
SQL Code for counting operational hours nancyb Access 1 October 3rd, 2006 12:02 PM
Force A File To Download harpua Classic ASP Basics 6 July 26th, 2004 01:06 PM
Force A File To download harpua Javascript How-To 2 June 23rd, 2004 02:03 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.