Does anyone know how I can run a vbs script from a macro. I have been cobbling one toghether but cannot get it to work.
Sub Main()
Dim objShell as Object
Set objShell = _
CreateObject(“WScript.Shell”)
objShell.Exec (“cscript \amhs-ediis1\Ad Hoc Reports\Frank\ED Scheduled Reports\SendmailEDISv2.vbs”)
End Sub
Thanks for the reply. Yes, I did try with a mapped drive and still the same.
I am running the macro from the Cognos Scheduler ‘Script file name:’ option in the Results tab. While monitoring the scheduler, I can see a dos window open and shut so I believe Cognos is firing the script. When I run the VBS script manually, it works.
I don’t have series 7 here to test my theory, but I thought I remember that to run through Cognos scripting it mattered what directory the executable resides in. Can you put the macro in the same directory as the reports, or is it already?