Push Button Process

938 views

Published on

An example of a fully automated process (a microcosm of my work)

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
938
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Push Button Process

  1. 1. Automation Example Push Button your work
  2. 2. Push button process <ul><li>The payroll processors job is one step </li></ul><ul><ul><li>Push the macro button </li></ul></ul><ul><ul><li>The macro figures out who has unapproved/unsubmitted Overtime and sends an email to their Manager </li></ul></ul><ul><li>This was an automation of a process the originally took about 150 hours a year and changed it to basically no hours a year. </li></ul>
  3. 3. Connect to Source Tables <ul><li>In order for this to work, some behind the scenes programming need to be done. </li></ul><ul><ul><li>1 st step is to link into the database (NetConsole is the timekeeping system) </li></ul></ul><ul><ul><ul><li>This example uses Microsoft Access </li></ul></ul></ul>
  4. 4. Combine tables in a query <ul><li>2 nd step is to combine the data in a query. </li></ul><ul><ul><li>The query allows multiple sets of data to be combined </li></ul></ul><ul><ul><li>Criteria and formulas then can be used to shape the data. </li></ul></ul>
  5. 5. Create a User Interface (Pivot Tables) <ul><li>3 rd step is the user view. </li></ul><ul><ul><li>A pivot table was used to connect to the data and illustrate the data in a friendly application (Excel) </li></ul></ul><ul><ul><li>It is also the basis for the Macro. </li></ul></ul><ul><ul><li>This spreadsheet also illustrates attendance data for the user on other tabs </li></ul></ul>
  6. 6. Macro to do work <ul><li>Sub Mackens_email_start_OT() </li></ul><ul><li>' </li></ul><ul><li>' Update Macro </li></ul><ul><li>' Macro recorded 2/7/2008 by durochs </li></ul><ul><li>' </li></ul><ul><li>' </li></ul><ul><li>Workbooks.Open Filename:=&quot;P:NetConsoleMackensMackensMackens.xls&quot; </li></ul><ul><li>Application.DisplayAlerts = False </li></ul><ul><li>Application.ScreenUpdating = False </li></ul><ul><li>Sheets(&quot;NonApproved_OT&quot;).Select </li></ul><ul><li>Range(&quot;A5&quot;).Select </li></ul><ul><li>ActiveSheet.PivotTables(&quot;PivotTable1&quot;).PivotCache.Refresh </li></ul><ul><li>ActiveWorkbook.Save </li></ul><ul><li>Sheets(&quot;NonApproved_OT&quot;).Select </li></ul><ul><li>Range(&quot;D1&quot;).Select </li></ul><ul><li>Dim x As Integer </li></ul><ul><li>x = Range(&quot;D1&quot;) </li></ul><ul><li>If x = 0 Then </li></ul><ul><li>ActiveWindow.Close </li></ul><ul><li>Else </li></ul><ul><li>Application.Run &quot;Overtime_Macro.xls!Mackens_email_OT&quot; </li></ul><ul><li>End If </li></ul><ul><li>End Sub </li></ul><ul><li>4 th step is the macro does the work the payroll processor use to do. </li></ul><ul><ul><li>It opens the spreadsheet </li></ul></ul><ul><ul><li>Then determines if there is any overtime. </li></ul></ul><ul><ul><li>If there is overtime it then starts the email macro. </li></ul></ul>
  7. 7. Macro to do work <ul><li>Sub Mackens_email_OT() </li></ul><ul><li>Dim OutApp As Object </li></ul><ul><li>Dim OutMail As Object </li></ul><ul><li>Dim strbody As String </li></ul><ul><li>Set OutApp = CreateObject(&quot;Outlook.Application&quot;) </li></ul><ul><li>OutApp.Session.Logon </li></ul><ul><li>Set OutMail = OutApp.CreateItem(0) </li></ul><ul><li>strbody = &quot;&quot; & vbNewLine & vbNewLine & _ </li></ul><ul><li>&quot;There are unapproved hours in NetConsole, an illustration of these can be found here P:NetConsoleMackensMackensMackens.xls, on the NonApproved_OT workbook. These are overtime hours that need to be approved today, so they can be added to the payroll run tommorrow&quot; & vbNewLine & _ </li></ul><ul><li>&quot;&quot; & vbNewLine & _ </li></ul><ul><li>&quot;&quot; & vbNewLine & _ </li></ul><ul><li>&quot;&quot; </li></ul><ul><li>On Error Resume Next </li></ul><ul><li>With OutMail </li></ul><ul><li>.To = &quot;Mike.Mackens@something.com&quot; </li></ul><ul><li>.CC = &quot;&quot; </li></ul><ul><li>.BCC = &quot;&quot; </li></ul><ul><li>.Subject = &quot;NonApproved Overtime Timesheets&quot; </li></ul><ul><li>.Body = strbody </li></ul><ul><li>.Send 'or use .Display </li></ul><ul><li>End With </li></ul><ul><li>On Error GoTo 0 </li></ul><ul><li>Set OutMail = Nothing </li></ul><ul><li>Set OutApp = Nothing </li></ul><ul><li>ActiveWindow.Close </li></ul><ul><li>Application.DisplayAlerts = True </li></ul><ul><li>Application.ScreenUpdating = True </li></ul><ul><li>End Sub </li></ul><ul><li>The next step is the email launch. </li></ul>
  8. 8. Push button process <ul><li>Once the setup is done, all that every needs to be done is the button push. </li></ul><ul><li>The payroll processor needs only to push a button (and even that could be pre scheduled via a macro). </li></ul><ul><li>The button can open as many spreadsheets as needed and send emails to those that fit the criteria. </li></ul>

×