Applicable to SignageTube Live

Microsoft Excel is a powerhouse in the business world. Many companies rely on it to manage everything from production figures to sales data. Its grid format and powerful formulas make it an accessible tool for organizing information. For many, it even functions as a content management system (CMS) or a simple database, feeding data directly into systems like SignageTube Live to display key metrics on digital screens.

This approach works well, but it often comes with a significant manual component. Data needs to be constantly updated, sheets need to be managed, and figures need to be copied from one place to another. A common scenario involves a plant manager who, every Monday morning, manually copies production data from a master spreadsheet to the specific sheet linked with SignageTube Live. This repetitive task, while necessary, consumes valuable time and is prone to human error.

What if you could automate this entire process? This article will show you how to use scheduled tasks and a simple script to run Excel macros automatically. You can set it and forget it, ensuring your digital signage is always displaying the most current data without any manual intervention.

The Limitations of Using Excel as a Manual CMS

While Excel is versatile, using it as a manual data source for digital signage has its drawbacks. The process is often inefficient and fragile.

The Monday Morning Data Shuffle

Consider the plant manager’s weekly task. At 6 AM every Monday, before the week’s production kicks into high gear, they must:

  1. Open the master production data spreadsheet.
  2. Open the separate SignageTube Live data spreadsheet.
  3. Carefully select and copy the relevant data for the upcoming week.
  4. Paste this data into the correct cells of the SignageTube Live sheet.
  5. Save and close both files, hoping no errors were made.

This “data shuffle” is a widespread practice. Sometimes, it involves more complex steps, like running a macro to perform custom calculations or reformat data before it’s ready for display. The entire workflow depends on a person remembering to perform the task correctly and on time, every single time.

The Hidden Costs of Manual Work

This reliance on manual updates introduces several risks and inefficiencies:

  • Time Consumption: What might seem like a quick 15-minute task adds up to hours over months and years. This is time that could be spent on more strategic initiatives.
  • Risk of Human Error: A simple copy-paste error can lead to incorrect data being displayed across the entire facility. This can cause confusion, impact decision-making, and undermine the credibility of the information system.
  • Dependency on Individuals: If the designated person is sick, on vacation, or forgets, the screens display outdated information. This makes the system unreliable.
  • Inconsistency: Different people might perform the task in slightly different ways, leading to inconsistent data formatting and presentation.

Automating Excel Updates with Scripts and Scheduled Tasks

The solution to these challenges is automation. By combining a Visual Basic for Applications (VBA) macro within Excel with the Windows Task Scheduler, you can create a hands-free system that performs these updates for you.

The process involves two main components:

  1. The Excel Macro: A macro that contains all the steps for updating the data.
  2. The VBScript and Task Scheduler: An external script that opens Excel and runs the macro, triggered by a scheduled task.

Let’s break down how to set this up.

Step 1: Create Your Automation Macro in Excel

First, you need an Excel macro that performs the data transfer. If you already have one for calculations, you can simply add the copy, paste, and save functions to it.

This macro will be the engine of your automation. It will open the source workbook, copy the data, open the destination workbook (your SignageTube Live file), paste the data, and then save and close everything.

Here is a sample VBA macro that accomplishes this. You can access the VBA editor in Excel by pressing Alt + F11.

Sub UpdateSignageData()
' --- User-defined variables ---
' Set the file path for the source and destination workbooks
Dim sourceFilePath As String
sourceFilePath = "C:\Data\MasterProductionData.xlsx"

Dim destFilePath As String
destFilePath = "C:\SignageTube\SignageTubeData.xlsx"

' Set the names of the worksheets
Dim sourceSheetName As String
sourceSheetName = "Weekly_Data"

Dim destSheetName As String
destSheetName = "Display_Data"

' Set the range to copy from and the top-left cell to paste to
Dim sourceRange As String
sourceRange = "A1:G50"

Dim destCell As String
destCell = "A1"
' --- End of user-defined variables ---

' Declare workbook and worksheet objects
Dim sourceWb As Workbook
Dim destWb As Workbook
Dim sourceWs As Worksheet
Dim destWs As Worksheet

' Disable screen updating to speed up the macro
Application.ScreenUpdating = False

On Error GoTo ErrorHandler

' Open the source and destination workbooks
Set sourceWb = Workbooks.Open(sourceFilePath)
Set destWb = Workbooks.Open(destFilePath)

' Set the worksheets
Set sourceWs = sourceWb.Sheets(sourceSheetName)
Set destWs = destWb.Sheets(destSheetName)

' Clear previous data in the destination sheet (optional)
destWs.Cells.ClearContents

' Copy data from source to destination
sourceWs.Range(sourceRange).Copy destWs.Range(destCell)

' Save and close the workbooks
destWb.Save
destWb.Close
sourceWb.Close SaveChanges:=False ' Close source without saving changes

' Re-enable screen updating
Application.ScreenUpdating = True

' Exit the sub
Exit Sub

ErrorHandler:
' Simple error handling: log the error to a text file
Open "C:\SignageTube\MacroErrorLog.txt" For Append As #1
Print #1, "Error at " & Now() & ": " & Err.Description
Close #1

' Ensure screen updating is re-enabled
Application.ScreenUpdating = True
End Sub

To use this macro:

  1. Open your SignageTube Live Excel file.
  2. Press Alt + F11 to open the VBA Editor.
  3. Go to Insert > Module to create a new module.
  4. Copy and paste the code above into the module.
  5. Crucially, update the file paths, sheet names, and ranges in the “User-defined variables” section to match your specific setup.
  6. Save the Excel file as a Macro-Enabled Workbook (.xlsm).

Code Sample: Running a Macro Directly from Excel

If you want to run your macro manually within Excel, you can do the following:

  1. Open your macro-enabled workbook.
  2. Press Alt + F8 to open the “Macro” dialog box.
  3. Select UpdateSignageData from the list, then click Run.

Alternatively, you can assign the macro to a button on your worksheet for easy access:

  1. Go to the Developer tab in Excel.
  2. Click Insert and select a Button (Form Control).
  3. Draw the button on your sheet, and when prompted, assign the UpdateSignageData macro.

This allows you to update your SignageTube Live data with a single click whenever needed.

Step 2: Create a VBScript to Run the Macro

You cannot directly run an Excel macro from the Windows Task Scheduler. You need a small helper script to bridge the gap. A VBScript (.vbs) file is perfect for this.

This script will open Excel, run your specified macro, and then quit the application.

  1. Open a plain text editor like Notepad.
  2. Copy and paste the following code into the editor:
' --- User-defined variables ---
Dim excelFilePath
excelFilePath = "C:\SignageTube\SignageTubeData.xlsm" ' Path to your .xlsm file

Dim macroName
macroName = "UpdateSignageData" ' The name of your macro
' --- End of user-defined variables ---

' Declare variables
Dim excelApp
Dim excelWorkbook

' Create an Excel application object
Set excelApp = CreateObject("Excel.Application")

' Make Excel invisible
excelApp.Visible = False

' Disable alerts (e.g., "Save changes?" pop-ups)
excelApp.DisplayAlerts = False

' Open the workbook
Set excelWorkbook = excelApp.Workbooks.Open(excelFilePath)

' Run the macro
excelApp.Run "'" & excelWorkbook.Name & "'!" & macroName

' Close the workbook
excelWorkbook.Close

' Quit Excel
excelApp.Quit

' Clean up objects
Set excelWorkbook = Nothing
Set excelApp = Nothing

  1. Update the excelFilePath and macroName variables.
  2. Save the file with a .vbs extension (e.g., RunUpdate.vbs). Be sure to change “Save as type” to “All Files” in Notepad to avoid saving it as a .txt file.

Step 3: Schedule the Task with Windows Task Scheduler

Now you can use the Windows Task Scheduler to run your VBScript at any time you choose.

  1. Open the Task Scheduler from the Windows Start Menu.
  2. In the right-hand Actions pane, click Create Task…
  3. General Tab: Give your task a name (e.g., “SignageTube Daily Update”) and a description. Select “Run whether user is logged on or not” to ensure it runs automatically.
  4. Triggers Tab: Click New… to create a schedule. Set it to run “Weekly” on “Monday” at “6:00 AM,” or whatever schedule fits your needs. Click OK.
  5. Actions Tab: Click New… The action should be “Start a program.”
    • In the “Program/script” box, enter: wscript.exe
    • In the “Add arguments (optional)” box, enter the full path to your VBScript file, enclosed in double quotes (e.g., "C:\SignageTube\RunUpdate.vbs").
  6. Conditions/Settings Tabs: Review the other tabs. You may want to uncheck “Stop if the computer switches to battery power” under the Conditions tab to ensure it runs on laptops.
  7. Click OK. You may be prompted to enter your user password.

That’s it! Your automation is complete. Every Monday at 6 AM, the Task Scheduler will execute your VBScript, which will in turn run the Excel macro. Your SignageTube Live data will be updated automatically, ready for the week ahead.

The Benefits of Automating Your Excel Workflow

By investing a small amount of time to set up this automation, you unlock significant benefits for your organization.

  • Increased Efficiency: You eliminate a repetitive manual task, freeing up valuable employee time for more critical responsibilities.
  • Enhanced Accuracy: Automation removes the risk of human error in data transfer, ensuring the information displayed on your screens is always correct.
  • Improved Reliability: Your digital signage updates are no longer dependent on a person’s memory or availability. The system runs like clockwork, providing consistent and timely information.
  • Greater Scalability: As your data needs grow, this automated framework can be easily adapted. You only need to update the macro, not retrain personnel on new manual processes.

Integrating automated Excel workflows with SignageTube Live transforms your digital signage from a manually updated board into a dynamic, reliable, and self-sufficient information system. It’s a simple yet powerful step towards a smarter, more efficient factory floor or office environment.

Get started with SignageTube!

FREE TRIAL

.
SignageTube
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.