Excel xlfileformat number in vb.net

R

Raymond Chiu

Dear all,

I am using ms office 2003 and visual studio .net 2003.
Now I want to export data to specified excel csv file format which would not
display strange characters in notepad.

From the web site, I find constants of xlfileformat.
http://msdn2.microsoft.com/en-us/library/aa249519(office.10).aspx

But the constants character does not pass compiler.
Is there any class path or number need in the coding?

Thanks for your help,

Raymond Chiu

==================================================================

With excel
.DisplayAlerts = False
.Application.ScreenUpdating = False
wb = .Workbooks.Add()
.Sheets("sheet1").Select()
For irow = 0 To dstemp.Tables(0).Rows.Count - 1
.Cells(irow + 1, 1) =
CStr(is_dbnull(dstemp.Tables(0).Rows(irow).Item(0)))
.Cells(irow + 1, 2) =
CStr(is_dbnull(dstemp.Tables(0).Rows(irow).Item(1)))
.Cells(irow + 1, 3) =
CStr(is_dbnull(dstemp.Tables(0).Rows(irow).Item(2)))
Next

.Application.ScreenUpdating = True

wb.SaveAs(sOutputFolder + sfilename + ".csv", xlCSVMSDOS)

End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top