Hi,
I'm getting the below error On converting Excel to PDF using vbscript

Object required: 'objExcel.ActiveWorkbook'
Code: 800A01A8


I have given the code below

Const xlTypePDF = 0
Const ppSaveAsPDF = 32

if Wscript.Arguments.Count > 0 Then

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objExcel = CreateObject("Excel.Application")

For i = 0 to wscript.arguments.count - 1
Set objFile = objFSO.GetFile(WScript.Arguments(i))

dirPath = objFSO.GetParentFolderName(objFile)
fileBaseName = objFSO.GetBaseName(objFile)

objExcel.ActiveWorkbook.SaveAs dirPath & "\" & fileBaseName & ".pdf", ppSaveAsPDF

objExcel.ActiveWorkbook.Close(False)
Next

objExcel.Quit
Else
msgbox("Select a file to convert")
End If