Hi I am trying to call a macro in test.xls using the following VB script

Option Explicit

Dim returnVal
returnVal = 0
WScript.Echo returnVal

Dim xlApp, xlBook

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("D:\test.xls", 0, True)
xlApp.Run "macro1"
xlBook.Close false

Set xlBook = Nothing
Set xlApp = Nothing

WScript.Echo returnVal
''WScript.Quit returnVal
The macro defined in test.xls is :

Dim returnVal as Boolean
sub macro1()
returnVal = 1
Exit Sub
End Sub
When I try to run the VB script I get a pop up window with value 0 (that is for the echo I am doing at the start). Then I get a pop up window with value 0 again. Looks like the value from the macro is not being returned.

Where am I going wrong here.