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
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