Effective December 3, NetApp adopts Microsoft’s Business-to-Customer (B2C) identity management to simplify and provide secure access to NetApp resources.
For accounts that did not pre-register (prior to Dec 3), access to your NetApp data may take up to 1 hour as your legacy NSS ID is synchronized to the new B2C identity.
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

WFA PowerShell Reports

SrikanthReddy

Error  Exception calling "SaveAs"

 

I am getting errors saving excel via powershell code in WFA

if any work around

 

 

 

$xl=New-Object -ComObject "Excel.Application"
$wb=$xl.Workbooks.Add()

 

#==Powershell Code for Report==

$wb.SaveAs($htmlReport,$xlHTML)
$wb.SaveAs($csvReport, $xlCSV)
$wb.SaveAs( $reportName,[Microsoft.Office.Interop.Excel.XlFileFormat]::xlExcel8)

 

 

 

6 REPLIES 6

geringer

Do you have Excel installed on the WFA server?

SrikanthReddy

Yes

 

Tested code works ok via powershell at command prompt

 

 

 

 

sinhaa

See, you have provided almost close to zero information for debugging and expecting a solution.

 

1. What are you actually trying to do.

2. What is the error message you get?

3. What values of variables $htmlReport,$xlHTML..

 

 

What can one make out from a few lines  from the middle of the code. It will not help. So provide sufficient infomation.

 

 

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

SrikanthReddy

Thanks sinhaa 

 

this was for testing if I could write excel  output to local drive via powershell on WFA server 

 

 

The only exception I am getting from  logs is

 

"Error  Exception calling "SaveAs" "

 

Can we save Excel workbook on local drive ? 

 

could be service account permission issues ,will report after testing 

 

geringer

Attached is a simple WFA command that you can "test" to see if you have an issue with your WFA server configuration, or if the issue is in your code.  This requires an open directory at C:\Temp\WFA to run.  It works on my laptop with WFA installed.

 

Mike

geringer

Not sure why the dar file does not show as an attachment, unless it is being filtered out as "software files".  Email me, and I will send you the attachment.

 

Mike Geringer

NetApp

Announcements
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.

NetApp Insights to Action
I2A Banner
Public