Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai all,
I develop one VB Application in VS2010. Now i need to implement String data has been Export to excel file. Here i clearly mention that not from datagrid to excel, String data into excel.
Please any one help me.
Only the string data has been exported to excel.
I done this in VB6 but i don't have idea to do in VB.NET.
Please help me .
Posted
Updated 1-Jan-12 19:05pm
v2

string data but from where ? user will give input or what ?
you have alreay done it in vb6. just explain the logic.
here is link to write string data in excel, check this[^]
 
Share this answer
 
Comments
Himachandra 2-Jan-12 1:11am    
Just Data has been coming from RS-232, I append that data to a string variable..... I need to save that string data into Excel file.
Himachandra 2-Jan-12 1:52am    
Here is my VB6 Code.......

Private Sub Form_Load()
On Error Resume Next
Data1.Connect = "Excel 8.0"
Data1.DatabaseName = CurDir & "\" & "data.xls"
Data1.RecordSource = "Sheet1$"
Data1.Refresh
If Err <> 0 Then
MsgBox "Select Excel File"
Alarmcmd.Visible = False
End If
End Sub

alm.Data1.Caption = alm.Data1.Caption & "DG LLOP Fault"
alm.Data1.Recordset("ALARM") = "DG LLOP Fault"
alm.Data1.Recordset("DATE") = Mid(rxd, alarm_count, 2) & "/" & Mid(rxd, alarm_count + 2, 2) & "/" & Mid(rxd, alarm_count + 2 + 2, 2)
alm.Data1.Caption = alm.Data1.Caption & " " & Mid(rxd, alarm_count, 2) & "/" & Mid(rxd, alarm_count + 2, 2) & "/" & Mid(rxd, alarm_count + 2 + 2, 2)
This article[^] should give you a fair idea of what you need to do.
The sample is in VB.Net and should help you out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900