Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Excel string VB.NET
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 1-Jan-12 19:59pm
Edited 1-Jan-12 20:05pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Comments
Himachandra at 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 at 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)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 200
1 PIEBALDconsult 150
2 BillWoodruff 148
3 Jochen Arndt 135
4 DamithSL 130
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 2 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100