Link to home
Start Free TrialLog in
Avatar of Bruce
BruceFlag for United States of America

asked on

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

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...
http://www.thescripts.com/forum/thread223814.html

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

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


ASKER CERTIFIED SOLUTION
Avatar of jmundsack
jmundsack
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce

ASKER

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

You get the points man!