Run Excel macro from Scheduled Task

C

coolthinking

Hello,

My target is to run everyday at 06:00 a macro within my Excel document
without being connected to the server where the file is located.
Based on previopus thread, I identified I have to to:
1. Use the Sub Auto_Open() => done.
2. Use a Scheduled Task with the Excel target file as parameter=> done.
3. Lower the Excel security to LOW => done.

Nonetheless, I am facing an issue as the Excel process starts correctly and
it look likes the target file is not loaded and therefore the macro does not
run or the target file is loaded and the macro does not run automatically.

Anyone can help me pelase :)
Best regards.

Coolthinking
 
B

Bob Phillips

Perhaps the macro is outputting a message, and with no-one around to
respond, it just waits.
 
C

coolthinking

Hello,

Thanks for the suggestion. However, the macro does not provide any messages.
Moreover, if I manually open the Excel file then the macro runs without
trouble.
 
B

Bob Phillips

Try moving the code in Auto_Open to workbook_Open in ThisWorkbook code
module.
 
C

coolthinking

Thanks for your help. I updated the Excel file with the changes you suggested.
Unfortunately, the issue remains identical, and I am still able to manually
open the Excel file and then having the macro running without trouble.

Coolthinking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top