If you missed the pre-registration for NetApp MS Azure AD B2C, the new login prompt will offer the option to register. Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Active IQ Unified Manager Discussions

how generate a excel report usuing WFA




I have created a script to collect capacity of all the filers and store it in excell.


while executing workflow i am getiing error.



Exception calling "Add" with "0" argument(s): "Add method of Workbooks class failed"







I believe the primary requirement to debug a code is to HAVE THE CODE.  Can you post your code?


Also you can create .CSV( Comma Separated values) reports which can be opened using MS XL. All you need is to add your report data in a .csv file.






If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.


Please find the code below.


$Excel = New-Object -ComObject Excel.Application


$Excel1 = $Excel.Workbooks.Add()

$sheet = $Excel1.Worksheets.Item(1)

$sheet1 = $Excel1.Worksheets.Item(2)

$sheet.Name = 'Backup_Filer'

$sheet1.Name = 'Backup_Isilon'

$Sheet.Cells.Item(1,1)= 'Location'


$Sheet.Cells.Item(1,2)= 'Purpose'


$Sheet.Cells.Item(1,3)= 'Storage Name'


$Sheet.Cells.Item(1,4)= 'H/W Model'


$Sheet.Cells.Item(1,5)= 'SerialNumber'


$Sheet.Cells.Item(1,6)= 'OS Version'


$Sheet.Cells.Item(1,7)= 'Raw Capacity (TB)'


$Sheet.Cells.Item(1,8)= 'Usable Capacity (TB)'


$Sheet.Cells.Item(1,9)= 'Allocated Capacity (TB)'


$Sheet.Cells.Item(1,10)= 'Unallocated Capacity (TB)'


$Sheet1.Cells.Item(1,1)= 'Storage Name'


$Sheet1.Cells.Item(1,2)= 'H/W Model'


$Sheet1.Cells.Item(1,3)= 'Raw Capacity (TB)'


$Sheet1.Cells.Item(1,4)= 'Allocated Capacity (TB)'






#Auto fit everything so it looks better

$usedRange = $Sheet.UsedRange

$usedRange1 = $Sheet1.UsedRange

$usedRange.EntireColumn.AutoFit() | Out-Null

$usedRange1.EntireColumn.AutoFit() | Out-Null


$Excel.Quit() -f

#Release COM Object

[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null




I'm assuming you want to port your script code into WFA (which can't output to an excel spreadsheet by default)

Are you using the EDM pack imported on your WFA server?




Any reason you need the data in a spreasheet? (IE do you need multiple related worksheets in workbook etc), if not and you just want a simple capacity report from WFA on your aggregates or volumes then it is "possible" to have WFA invoke a SQL query for your volume\aggregate capacity, output it as a .csv file then add a WFA return paramater for the URL to download the .csv file (or have WFA email you the .csv file to you). This can be used as an alternate method instead of creating a custom OCUM report...however "possible" does not necessarily equate to "advisable"


There are multiple ways to get this information you are probably looking for however considering the WFA database is just a cache of the OCUM database have you considered using the OCUM to schedule a report and email it to you in .csv or .pdf format??? I'd advise looking at the default "Aggregate Capacity and Utilization" or "Volume Capacity and Utilization" reports.


You "could" re-create the OCUM reports using WFA or a script...but why re-invent the wheel?



If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.