

You will need to change the value of MacroPath variable to direct the automation to the precise macro you would like to run. Make sure to include your Excel’s file name and extension at the end of the path. You will need to change the value of ExcelFilePath variable to point to the exact file path of the Excel file you would like to open. To launch Notepad and Windows Task Scheduler, simply type in their respective names into the search bar on your Taskbar and open the applications.Īfter you have pasted in the code, you will need to modify it to suite your needs. You should already have all of these programs pre-installed on your PC.ĬScript (Located: C:\Windows\System32\cscript.exe) To fulfill this solution, we will be utilizing a few programs outside of Excel.
#How to enable vba in excel 2016 how to#
However, if you know your way around a Mac, you may be able to figure out how to implement a similar solution on the Mac OS.
#How to enable vba in excel 2016 Pc#
Sorry Mac folks, this is only a PC solution. The ONLY CATCH to this solution, is that the PC will need to be on during the scheduled time. With this solution, you will be able to customize the frequency and exact time(s) this automation will need to be executed. This article will go through how to utilize the Windows Task Scheduler application (don’t worry, this comes installed with most Windows PCs) to automatically open an Excel file, run it’s VBA code, save the file, and finally close the Excel file. As I work through getting this setup, I figured I would document my solution for everyone. I’m currently working on a consulting project where a VBA macro within an Excel file needs to run every morning before folks get into the office.
