troubleshooting Question

Save excel as csv format when using Late Binding

Avatar of TommyTwoPints
TommyTwoPintsFlag for Thailand asked on
Visual Basic.NET
5 Comments1 Solution819 ViewsLast Modified:
Hi Experts,

I am using late binding to open Excel in vb.net 2002.

I have opened a workbook and wish to save it in CSV format, problem is when i type Format:=xlcsv as an argument for the workbook.saveas function call the error is xlcsv is not declared. I know why this happens; its because excel is not referenced.

Here is a similar example to my code

Dim XL as object
XL= CreateObject("Excel.Application")
Dim Wbk as object
Wbk=XL.Workbooks.Add
Wbk.SaveAs(FileName:=OutputPath, Format:=XlCsv)

Is there a way i can save the workbook as a csv when using late binding?

Cheers,

Tom
ASKER CERTIFIED SOLUTION
vadim63

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros