Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to log data to excel spread sheet in vb.net app?

Status
Not open for further replies.
Joined
Jul 25, 2012
Messages
1,192
Helped
171
Reputation
342
Reaction score
162
Trophy points
1,343
Activity points
0
Hello!

I want to know how to log data to a excel spread sheet embedded in a vb.net application? The excel sheet will be saved as excel file from the vb.net app and it can be later opened in excel.

I get data from usb which will be in a buffer (array). I want to know how to put the contents of array to cells in excel sheet embedded in a vb.net app.



Thanks
Jayanth D
 

You should know that MS Excel have rows limit at 65536.

Better use CSV file format, and generate that file as log result of your application. Later you can start Excel and import data from that file, or you can import that CSV in any other application which support that format.


Here you can see rest limitations :

**broken link removed**



See this materials :

https://www.codeproject.com/Articles/19840/Export-to-Excel-using-VB-Net

https://www.dreamincode.net/forums/topic/30239-send-data-to-excel-spreadsheet/

**broken link removed**


;-)
 
Last edited:

Hi! tpetar

How to create files in .csv format and what application should I use to open .csv files?

-------------------Update---------------

OK. tpetar. I got it. I put the string Hello, World in a text file and then saved it as .csv file and opened it in excel to see Hello and World in 2 different Cells.

Thanks. I will use .csv files for formatting my datalogger data.
 

OK. tpetar

I tries like this

I put the data in the text file like this

10/11/2012,10:31:56: AM,126.21728
10/11/2012,10:31:56: AM,126.21728

and saved the .txt file as .csv file and opened it in excel

what I got was

###### ###### 126.21728
###### ###### 126.21728

###### is in one cell, another ###### is in another cell, and 126.21728 is in 3rd cell.

why I am not getting date and time when opened in excel?


Jayanth D
 

All is ok, just increase width of colums, and values will show up.

In Excel when data cannot be showed in columns # is used.


CSV is comma separated file, where you put "," next data goes to new column (cell).

- - - Updated - - -

Additional to that in Excel you can later change cell configuration type, and set column with date information as date values in Excel, also is for time values. Data configured like in Excel can be used in formulas and other calcs.

You can write VBA script to make all automaticly, completely all including and importing data file.

Excel worksheet can be linked with some external data such this csv file, and dynamically update table, even Web site content.
 

I want to embed Excel in VB>net app. Can I open .csv from vb.net app if I embedd excel in vb.net.

I added the com component for Microsoft Office Spreadsheet 10.0 to so that the tool appears in the visual studio toolbox, but when I place the tool on the form visual studio crashes. why? I am not able to embedd excel in vb.net 2010


Thanks
Jayanth D
 

You can do that, of course, that works.

You should do troubleshooting, and check Microsoft knowledge base for Visual Studio. What to say Welcome to Microsoft World. :smile:
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top