We help IT Professionals succeed at work.

Save an Excel file to CSV in a client side VBScript in an ASP.NET 2.0 app.

Bruce asked
Last Modified: 2013-11-26
Need to be able to save an Excel file to CSV in a client side VBScript in an ASP.NET 2.0 app.

This following code works fine until the SaveAs.  Excel.XlFileFormat.xlCSVWindows seems to be undefined.

Set appExcel = createobject("Excel.Application")
Set myworkbook = appExcel.workbooks.open(fileName)
Set allwShts = myworkbook.Worksheets
...do some work...
fileNameCSV = left(fileName, len(fileName)-3) & ".csv"
myworkbook.SaveAs fileNameCSV,  Excel.XlFileFormat.xlCSVWindows

Here's another guy with the same problem...

There are only two pages returned from Google when searching "Excel.XlFileFormat.xlCSVWindows"

Can I hard code a value for the call to SaveAs?

Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)


I did find that just a few minutes ago but thanks.

You get the points man!

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.