15,902,937 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10530881 (Top 4 by date)
Member 10530881
21-Jan-14 14:28pm
View
Hi Christian,
I do not know how to write a service. Below is my code. If I run the code, it works; however if I leave it with the OnTime statement, it does not run once the time approaches.
Sub openFile()
Application.OnTime TimeValue("13:00:00"), "refreshFile()"
End Sub
Sub refreshFile()
Workbooks.Open Filename:= _
"C:\Users\v-giwhal\Documents\Bulk Update Reports\FY14 CR CAM Qualified Opportunity Report"
Application.Run "'FY14 CR CAM Qualified Opportunity Report.xlsb'!refreshAll"
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
Member 10530881
21-Jan-14 9:56am
View
That is not what I meant. I am new to code writing and miss used terminology. I want to lave my laptop on sleep or in hibernation mode but have a written code that will automatically run the macro after hours so the refreshes are completed overnight given the refresh time.
Member 10530881
21-Jan-14 9:52am
View
Below is my code and at the specified time, nothing is happening.
Sub openFile()
Application.OnTime TimeValue("9:50:00"), "refreshAll"
Workbooks.Open Filename:= _
"C:\Users\v-giwhal\Documents\Bulk Update Reports\FY14 CR CAM Qualified Opportunity Report"
Application.Run "'FY14 CR CAM Qualified Opportunity Report.xlsb'!refreshAll"
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
Member 10530881
21-Jan-14 8:31am
View
Yes, I am looking for a code to start a macro I wrote while the computer is in sleep or hibernating for example. The total refresh time is 6+ hours and I am trying to find a way to do this outside of work hours in lieu of waking up at 2 a.m. to start the macro. I am new to writing codes and macros; therefore any assistance would be greatly appreciated.