Is there a way to launch Excel in the background at system boot up and run a VBA macro to write information to a log file, then quit Excel?
As far as I know you can't run it in the background using a command-line switch. You could write an external app to call excel using its com interface. You could even use vbscript to do this if it is enabled on the system which is similar in syntax to vba. If a *.vbs file can't be run at startup you could call it from a batch file or something.
if you create a shortcut to a workbook, in the startup folder, you can have code in startup to set the application to visible = false, write your log file then quit the application without saving anything
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
Thanks guys, the suggestions worked great! I put a shortcut of the vbscript file in the startup folder and everything works perfectly; Excel launches in background upon system boot and the log file gets updated w/o any sign that anything happened. Slick.