0
votes

I don't have much knowledge in creating a VBScript file. I have a code i want to automate to send email out every month. With some research i found the code below:

dim EXL
    set EXL = CreateObject("Excel.Application")
    'not required
    EXL.Visible = true

    'your file and macro    
    EXL.Workbooks.Open "full path to your excel file including extension here" 
    EXL.Run "Fixing"

    'close everything
    EXL.Quit
    Set EXL = Nothing

My Question is: do i implement this code into my excel module or is in the worksheet event?

Once i have this correctly applied i will be able to set the Windows Task Scheduler to run at the particular time.

1
Just save the VBscript file as a *.vbs file. Create a text file (txt), copy your code and save the file with the vbs extension. Next go to the Windows Task Scheduler and choose Run a Program and locate your VBS - AnalystCave.com

1 Answers

2
votes

Just save the VBscript file as a *.vbs file. Create a text file (txt), copy your code and save the file with the vbs extension. Next go to the Windows Task Scheduler and choose Run a Program and locate your VBS.

Sending emails from VBscript

http://www.analystcave.com/excel-send-email-excel-workbook/

Scheduling programs to run in Windows

http://windows.microsoft.com/en-au/windows/schedule-task#1TC=windows-7