• Status: Solved
  • Priority: Medium
  • Security: Private
  • Views: 48
  • Last Modified:

Excel Macro Question

I will try to explain this the best I can from the information a user gave me.

So apparently he has a macro on Excel 2016 that runs which fixes a raw .xlsx file by formatting it to the end users specifications. So to break it down a program outputs a .xlsx in raw format then he opens the raw .xlsx file on his computer and runs the macro to fix the formatting.

The question we have is can we automate this process in task scheduler or something similar to run the macro on the raw .xlsx file on someone's computer or a server? Most likely the user will not have Excel open because this will occur around 5 am when no one is working.

(Program outputs .xlsx  to network drive > user's computer or server runs the automated macro to the format data > end user is able to use the output.)

Thanks for helping!

- Excel 2016
- Windows 10 Pro x64 or Windows Server 2012 R2
1 Solution
Better convert VBA code to a Visual Studio console app, that way you're sure the scheduled task will run properly.
If you use Excel, maybe security prompts or other user interaction will cause the task to fail.
Máté FarkasDatabase Developer and AdministratorCommented:
Yes, this is possible.
Let's call your macro procedure  Public Sub DoFormattingMarcro then you can call the following command in Task Scheduler:
EXCEL.EXE “YouFileWithMacro.xlsm” /a DoFormattingMarcro

Open in new window

ITSysTechSenior Systems AdministratorAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now