Run Macros In Scheduled Task
Nov 24, 2007
I've used Excel 2003 to write a macro to analyse some date from our internal proprietary database. I use some Perl to generate a bunch of csv files from the data, and the run the macro to generate graphs and statistics from that. What I would like to do now is run this entire operation as a scheduled task, so that, every week or so, the data is downloaded, the processing is done on the csv files, and the results are saved to a location to be viewed on our internal site.
I'm assuming that the best way to do this would be somehow run something from the command line (to be embedded in a script) which basically says "1) Open this csv file 2) run this macro 3) save the output to this location", but I can't figure out how this can be done.
View 3 Replies
ADVERTISEMENT
Oct 1, 2011
What I do know is how to set up a task in Task Scheduler and I have it set to open my Excel file: Workbook1.xlsm. This task is set to run at 7am each morning. Workbook1.xlsm has a bunch of different macros in it.
What I'd like to do is to have each of those macros to run automatically when the file is automatically opened by Task Scheduler.
View 4 Replies
View Related
Sep 10, 2007
I am looking for a funtion that will help me add the hours someone is scheduled to work. The problem I am having is the format. Here's the format: The days of the week are Mon - Sun (D3-J3). L3 is a total of the hours they are scheduled to work for the week. Cell D3 is 8-2. Cell E3 is 9-3, etc. for the rest of the week. What I am looking to see if possible is in L3 take the row, Take D3 at 6 hours, E3 at 6 hours, etc for the rest of the row, and add them together for the total hours in L3. I have attached a small example file of what I'm trying to do. The format I am looking to use for the hours is as described above.
View 11 Replies
View Related
Jul 16, 2012
I have a button that runs a macro every 5 seconds.
I have another button to stop the loop.
Problem happens if a user hits the stop button when the sequence is not running - they get an error.
Here's my code for button 1 (start) and 2 (stop):
Code:
Sub Process_Emails_and_Backup_Auto()
Application.Run "Process_All_Emails_In_The_Inbox"
runtime1 = Now + TimeValue("00:00:05")
Application.OnTime runtime1, "Process_Emails_and_Backup_Auto"
End Sub
Sub StopProcessing()
Application.OnTime runtime1, "Process_Emails_and_Backup_Auto", , False
End Sub
Is there a way for button 2 - the StopProcessing macro - to run a test like If process is scheduled then run this code - if not then don't?
View 2 Replies
View Related
Jan 20, 2013
I have attached a portion of a schedule I have been asked to update to show when more hours are scheduled for a time period than are available on the schedule.
Each Dept.(Man. and DCC) has 16 hours available per day, M-F.
How can I chart or show somehow when a conflict arises? I need to outsource the excess time to another facility in a timely fashion.
Attached File: GKirbywork overload.xlsx
View 4 Replies
View Related
Jan 28, 2003
I have a worksheet that runs a query from an external data program. I have made a macro that refreshes the worksheet and this works ok. Is there a way I can get Scheduled tasks to automatically update this workbook eg overnight. I do not want to leave the workbook open either. Can task scheduler open the workbook, refresh the data, then close the workbook again.
View 9 Replies
View Related
Sep 18, 2008
I have the following macro:
Sub ScheduleUpdate()
WaitHours = 0
WaitMin = 15
WaitSec = 0
NextTime = Now + TimeSerial(WaitHours, WaitMin, WaitSec)
Application.OnTime EarliestTime:=NextTime, Procedure:=LinkUpdates()
Application.Run
End Sub
Sub LinkUpdates()
Sheets("PRICING SHEET").Select
Sheets("PRICING SHEET").UpdateLink Name:="P:CommonPRICINGCOMPILATION.xls", Type:=
xlExcelLinks
End Sub
The code does not work at all, just the skeleton to have an idea. I also need help recreating an entirely new macro which preferably works well!
The idea is that everyday at 8:00AM this macro starts automatically updating the links every 15 mins (SHOULD NOT MATTER IF THE SHEET IS OPEN OR NOT). But here is the catch.
This code should be the code for a checkbox. So when the box is checked, or TRUE, the macro should run normally updating every 15 mins. But when the box is unchecked, the macro should stop (no update occurring).
I want this macro because this sheet is linked to several other sheets and it needs constant updating. However, if I need to make a change in the main sheet, no updates should be happening.
View 9 Replies
View Related
Dec 27, 2006
I scheduled a task to open excel and when it does (at a certain time), a little sub is supposed to run (couple minutes later) via the OnTime Method located in the Workbook Open Event. There is one weird thing though....
1. When Excel opens automatically through Scheduled Task (and you see the clean white sheet WITH gridlines), Sub does NOT run (that is, my file is NOT even opening).
2. When I myself open Excel manually WITHOUT opening a new workbook (in other words, in front of you there will be grey area without gridlines), Sub runs perfectly (in other words, my file opens automatically and Sub performs whatever it is supposed to do).
View 7 Replies
View Related
Feb 28, 2007
Is there any way to find out how many people are scheduled between certain time ranges.
For example : I have 5 people scheduled with various start and finish times ie.:
1. 10:00 to 15:00
2. 11:00 to 16:00
3. 08:00 to 14:00
4. 13:00 to 15:00
5. 12:00 to 16:00
Is there any way to analise this schedule in format:
08:00 till 9:00 1 scheduled
09:00 till 10:00 1 scheduled
10:00 till 11:00 2 scheduled
11:00 till 12:00 3 scheduled
12:00 till 13:00 4 scheduled
13:00 till 14:00 5 scheduled
14:00 till 15:00 4 scheduled
15:00 till 16:00 2 scheduled
16:00 till 17:00 0 scheduled
View 10 Replies
View Related
Aug 17, 2014
I have a set of data I need to count.
The data consists of 2 columns essentially, Scheduled Delivery Date and Actual Delivery Date.
If the Delivery was made on time or early, I want to count it. I will do a similar count for Late as well.
Additionally, the user can enter the Scheduled date range they want to count early/on time deliveries from. There all also blanks in the Actual Delivery date column where deliveries have not been made (no actual).
Cells O3:O38 contain the Actual dates
Cells N3:38 contain the Scheduled dates
Cell B3 contains the begin date to start the range.
Cell B4 contains the end date of the range.
I have tried using COUNTIFS and am having trouble getting the formula to work.
I tried:
=COUNTIFS(O3:O38,O3:38<=N3:38,N3:N38 ,>=$B$3,N3;N38<=$B$4)
I know this will not work but I hope it shows the logic I want.Count range O3:O38 where values in O3:O38 are less than or equal to the corresponding cell value in N3:N38, for a range of N3:N38 that is greater than or equal to the date in B3 and less than or equal to the date in B4.
View 14 Replies
View Related
Jul 23, 2014
I am trying to take scheduled start time and scheduled duration in h:mm and auto populate the scheduled minutes in the corresponding time blocks.
Example:
Schedule ID
Start Time
Duration
8AM
9AM
10AM
11AM
12PM
1PM
2PM
3PM
4PM
[Code] ....
The first 3 columns are derived from a data table and I am trying to auto populate the minutes scheduled in the time blocks using conditional formatting or some other mechanism.
I'm using Excel 2010
View 4 Replies
View Related
Aug 26, 2009
I have an Excel 2003 program that contains macros. One of the macros hides certain command bars and disables the worksheet menu bar. On close the opposite is true. The problem is, if a user uses the disable macros when opening then the worksheet menu bar and other command bars are still available. I would like to hide all of the data sheets and display another sheet that would normally be hidden displaying a message that the macros have to be enabled for the program to work correctly if disable macros is chosen. When the enable macros are used I would like the Error page to be hidden.
View 6 Replies
View Related
Jul 12, 2013
I'm a fairly new user to using VBA and I'm currently running into a little snag. I'm trying tu create userform which will let me know if a person already exists in my sheet by looking up the last name in "A", then looking up his first name in "B", if such entry exists then display a message saying " Yes". If entry user has not been entered in the sheet then use a combox, to select the reason , then choose a date ( i have a working date picker ). Then entry should be entered in sheet (Name, Surname, Reason, date).
Whats working, I can use all of the above to enter all the info into the sheet, what I need to do is verify if user is alread in there, if not, then add it. The so on and so forth
View 3 Replies
View Related
Nov 26, 2008
Excel cannot complete this task with available resources. Choose less data or close other applications. My file is only about 3mb in size, made up of 17 worksheets. These sheets are calculated by referencing to another file that contains all of the background data. The data file is also about 3mb, made up of 13 worksheets.
There are probably about 2 - 3 thousand formulas in the file in total, ranging including vlookups, sumifs, sumproducts, etc. When the data was contained within the file there was no problem. I moved each data sheet into a new workbook to trim the size of my file and also stop the incessant calculation and this is when the problem started. Now, when I open the file and am prompted to update, it will update to about half way and then throw up the error message!
View 4 Replies
View Related
Jan 11, 2012
I have 2 sheets with a formula in sheet 2 looking to pick up information from sheet 1. the formula in sheet 2 is:
=HLOOKUP(C8,'Cost-Effort'!$B$7:$AH$42,26, FALSE)
But C8 appears in W7 and X7 in sheet 1 and will only pick up the first Occurrence and I need it to pick up the second Occurrence for this specific task.
View 6 Replies
View Related
May 6, 2013
I have this excel workbook with VBA code that starts when the workbook is opened.
Every day at 12:00 the windows task scheduler opens the file (hidden). The problem is that my computer is not always turned on at 12:00 hence it would be better if I could store the file in the cloud and run task scheduler from there.
In an optimal world there also has to exist a dropbox connection.
View 2 Replies
View Related
Jun 6, 2013
I have a PDF sheet with info laid out like this:
Code:
Peter Paul Mary
Text Corporation
One two three street
Mars, New York 90000 USA
phone: (111) 555-2222
email: tellmewhy@yahoo.com
There are 10 names and addresses like this on each PDF page and the entire PDF file has 50 pages so to manually copy and paste each bit of info into separate cells on the spreadsheet's appropriate cells "Name, Company, Address, State, Phone, Email" e.t.c is too difficult.
View 1 Replies
View Related
Jul 29, 2013
I have a large spreadsheet set up with multiple rows, I have the formula -
=a5&"repeated text"&c5
this brings back 2 results
test repeated text test
repeated text
In the instance this is the latter with no combined cell vale, how would I mass delete them?
View 2 Replies
View Related
Nov 6, 2013
I need a macro in a excel for the below scenario:
1)i have merged cells from A1:B3
2)if i click on a macro the output in the above cells should be as follows"
"Login to database"
3)if i run the same macro for the 2nd time the output should be:
"Are you done with the reporting?"
4)if i run for 3rd time the output should be:
"Logoff from database"
5)Say example if i run the same macro for 1o times i should get 10 different outputs....if i run for the 11th time the output should get repeat from 1st....
6)Output need not be in order....random also fine...
If possible gimme 2 different codes:
1)Output should be in the order wise from 1-10 and get started from1 again
2)Output should be random....
View 4 Replies
View Related
Mar 18, 2007
I have a sheet to calculate Time Elapsed based on StartDT & EndDt taking into consideration the actual working hours in any working day and the function exclude the weekend. I am not a guru in excel but i found this formula in this website .
=IF(AND(INT(StartDT)=INT(EndDT),NOT(ISNA(MATCH(INT(StartDT),HolidayList,0)))),0,ABS(IF(INT(StartDT)=INT(EndDT),ROUND(24*(EndDT-StartDT),2),
(24*(DayEnd-DayStart)*
(MAX(NETWORKDAYS(StartDT+1,EndDT-1,HolidayList),0)+
INT(24*(((EndDT-INT(EndDT))-
(StartDT-INT(StartDT)))+(DayEnd-DayStart))/(24*(DayEnd-DayStart))))+
MOD(ROUND(((24*(EndDT-INT(EndDT)))-24*DayStart)+
(24*DayEnd-(24*(StartDT-INT(StartDT)))),2),
ROUND((24*(DayEnd-DayStart)),2))))))
the formula works perfectly except for the fact that in our part of the world we have "Friday & Saturday" as the weekend days instead of Saturday and Sunday.
is there a way to get this formula or any similar formula to take different weekend days and do exactly what i need?
View 9 Replies
View Related
Dec 22, 2006
I need to work with a spreadsheet with 15000 rows of data. By the time I link this file with my final file and add formulas, my file has reached a massive size and the following pop up error message appears.
View 3 Replies
View Related
Jun 19, 2007
I am using code that creates a new workbook and then copies a number of sheets to the new workbook. I am using Application. ScreenUpdating = False but as the sheets are being copied over, the Excel task bar button jumps around.
View 2 Replies
View Related
Sep 21, 2007
I am trying to create a task list from a master matrix of items to be completed. When fully populated the maters matrix should have approximately 200 items to be completed over the year. I want to create a monthly to do list in EXCEL based on the master matrix. Some reports will be due on various timeframes. The reports will also be assigned to different workers. I would also like to be able to provided brief instruction for each task. Items will be added and subtracted from the master list based on changing requirements. I would like each month to be a different tab in the workbook. Attached is a spreadsheet that better explains what I am looking to create.
View 7 Replies
View Related
Mar 21, 2013
I am trying to write a macro that will allow me to add task to [url].... (task managing webpage) from data within excel. I could easily write a macro that emails the information to my toodledo email address, but this is not what I would like to do.ow to start the code utilizing Toodledo's API, which can be found here:
View 5 Replies
View Related
Apr 29, 2014
Ive been looking at a bunch of examples, but everything that I have tried just gives me errors. what code to use to make a vbs script to run in windows task scheduler that will...
Open "J:GroupsBSHEETSSDANew EOD.xlsm"
Run the macro named "EODPrint"
Save the workbook
and close the workbook
Leaving excel open if other instances exist.
View 9 Replies
View Related
Aug 1, 2009
Can a macro from Excel VBA create a Task in Outlook?
I would like to have Excel create a task populated with a date in a given cell in Excel.
Basically, click a button and a task is creaed in Outlook based on the date in a given cell.
Is this possible?
View 10 Replies
View Related
Oct 31, 2008
I am trying to make certain changes to the page setup on all sheets in a workbook. Here is my code but something is not working. I think I need to somehow select the next sheet because the macro is only performing the task on the active worksheet. My Visual Basic skills are somewhat limited so I'm sure this is not the most efficient way.
View 3 Replies
View Related
May 25, 2012
i have a validation list in A5 pointing to F6:F, i need the refmask_no to change according to the validation list in A5:A.
So if i choose from List LEADCASH the refmask_no= '100007995' etc
How can i automate the changing of refmask_no?
Sheet1 ABCDEF4Validation ListCorr _acc_no Mapping 5LEAD CASH ABNAMROrefmask_no = '100007997'
Corr_acc_noLead Set6 '100007995'LEAD CASH7 '100020741'LEAD CASH ABNAMRO8 '100020645'LEAD CASH AUDNZNR9
View 1 Replies
View Related
Jun 27, 2012
I currently use task scheduler to open a a spreadsheet at 4am every morning and run a macro. This macro refreshes data pulled from an accounting software. The macro also closes the spreadsheet at a specific time. After this is complete I have task scheduler open a separate spreadsheet and runs a macro to pull the data from the first spreadsheet into a dashboard presentation of sales data.
This all works fine...what I am looking to do is make sure both instances of excel get closed. Currently, this whole process is complete around 6am and when I get to work around 7 or 8 am there are two instances of excel still open. The workbooks are closed but excel is still open. When I am in the office I can just close these instances of excel but if I am out of the office these two instances of excel stay open and mess things up for the next mornings refresh.
Is there a way to make sure both instances of excel get closed? I am using the code below to close the spreadsheets.
Code:
Sub Closeworkbook()
ActiveWorkbook.Close True
End Sub
View 2 Replies
View Related
Jan 17, 2014
I have a repetitive task that needs to loop effectively. The only things that change each time are the start Columns ("C:C") next moves to ("D:D"), this then continues down the different columns, until it reaches the end of the columns.
The other thing that changes is the formula initially it starts at RC[-1]&"",""&RC[1]. Next time the numbers will be plus one, so RC[-2]&"",""&RC[2].
The last thing that moves is the "B1:B" & LR on the next step will move to "C1:C" & LR.
Basically a loop with variables in the loop. Is this possible? Below is the code I have begun to write but I could be writing this for ever, over and over again.
Code:
LR = Cells(Rows.Count, "A").End(xlUp).Row
Columns("B:B").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B1").Select
ActiveCell.FormulaR1C1 = "=RC[-1]&"",""&RC[1]"
Selection.AutoFill Destination:=Range("B1:B" & LR)
[Code] .......
View 3 Replies
View Related