hookahmasta
IS-IT--Management
I made myself a nice little VB Script, partly inspired by some feedback here, that...
a. Opens Excel
b. Opens file
c. Runs Macro which
c1. Runs a pivot refresh on the Excel file
c2. Does a print to the Adobe "printer", thus creating a PDF file in a specific directory
d. Quits Excel
f. Sends the PDF file out to specific receipents.
The last step, step F, is where I'm getting tripped up. For some reason, the PDF file, when it arrives in my mailbox, it's corrupted, with the message "An unrecognized token '(insert random character' was found", thus resulting in a blank PDF file. I've verified that the original PDF file is fine, since I can open that without a problem. Here's the last part of the script, which sends the file.
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "(email address)"
objEmail.To = "(email addresses)"
objEmail.Subject = "MACROS RULE!"
objEmail.Textbody = "blah blah blah"
objEmail.AddAttachment "(file location)"
objEmail.Send
Set objEmail = Nothing
Keep in mind that I'm a VB n00b, so any input would be appreciated.
a. Opens Excel
b. Opens file
c. Runs Macro which
c1. Runs a pivot refresh on the Excel file
c2. Does a print to the Adobe "printer", thus creating a PDF file in a specific directory
d. Quits Excel
f. Sends the PDF file out to specific receipents.
The last step, step F, is where I'm getting tripped up. For some reason, the PDF file, when it arrives in my mailbox, it's corrupted, with the message "An unrecognized token '(insert random character' was found", thus resulting in a blank PDF file. I've verified that the original PDF file is fine, since I can open that without a problem. Here's the last part of the script, which sends the file.
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "(email address)"
objEmail.To = "(email addresses)"
objEmail.Subject = "MACROS RULE!"
objEmail.Textbody = "blah blah blah"
objEmail.AddAttachment "(file location)"
objEmail.Send
Set objEmail = Nothing
Keep in mind that I'm a VB n00b, so any input would be appreciated.