HighTechTalks DotNet Forums  

Excel xlfileformat number in vb.net

Dotnet FAQs microsoft.public.dotnet.faqs


Discuss Excel xlfileformat number in vb.net in the Dotnet FAQs forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Raymond Chiu
 
Posts: n/a

Default Excel xlfileformat number in vb.net - 10-24-2007 , 08:35 PM






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/lib...ffice.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



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.