I have a data in list at vb.net and i want export to Excell. I have tried the code from Jx_man in thread "Export Data from listbox to Excel" , but it can't worked.

Dim MsExcel As Excel.Application ---> Error Statement is not valid in a namespace
I use Microsoft Excel 12.0 Library Object

Please Help me!!! Thanks...

add this to the very top of your project

Imports Excel = Microsoft.Office.Interop.Excel

make sure Microsoft Excel 12.0 Library Object is referenced in your project under
Project -> add reference

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.