I am using the following code at the bottom of this post to do an Essbase Retrieve on all of the sheets in a spreadsheet, but I would like to change it to have it do an Essbase Zoom to "All levels". I found an old post on the internet saying you can use the following format to do the zoom, so I started a new module and used the format below but changed it to my tab name and changed it to "2" for "All levels" but it doesn't work for me and I keep getting this error message saying, "Compile error: Wrong number of arguments or invalid property assignment". I would like to just change the "EssVRetrieve" in the code at the bottom to "EssVZoomIn", but that doesn't work either. Does anyone know how to edit this code correctly to make the macro do the zoom (even if it is just for one tab instead of the efficient way in bold below)?

EssVZoomIn(sheetName, range, selection, level, across)

where level is from 1 to 7

1 Next level
2 All levels
3 Bottom level
4 Sibling level
5 Same level
6 Same generation
7 Calc level

eg: EssVZoomIn("Pull Low Level", b5, b5, 3, True)



Declare Function EssVRetrieve Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal Range As Variant, ByVal lockFlag As Variant) As Long

Sub Retrieve1()
'
' Retrieve1 Macro
' Macro created by tescobar 4/1/13
'

'
Dim mySheet As Worksheet

Sheets("EndBalsht").Select
Range("A1").Select

For Each mySheet In Worksheets
mySheet.Select
Range("A1").Select
X = EssVRetrieve(Null, Null, Null)
Next mySheet

Sheets("EndBalsht").Select
Range("A1").Select

End Sub