Maker Pro
Maker Pro

Excel, logging, and import

L

Leeper

Jan 1, 1970
0
Is anyone familiar with getting Excel to automatically log data from a
RS-232 port, importing it automatically into a spreadsheet?

I saw it done once, and not sure how it was done, or if it was a hidden
macro or something.
 
G

Grzegorz G.

Jan 1, 1970
0
You can write script in Visual Basic or build an application (written in
C++) and You have to use OLE. Just look at Excel & Visual Basic help.
RS-232 port is supported by instructions:
OpenFile(.....) - open RS port
CloseFile(...) - close port
ReadFile(...) - read data from port buffer
WriteFile (...) - write data to port buffer
Below there are few lines of code (C++) that open excel from application and
add workbook.

Variant XL,v0,v1,v2, v22,
my_point,my_series,my_cell,my_workbooks, my_worksheets,
my_range,Xrange,Trange,Urange,Irange,Qrange,cell1,cell2,
WD,a,b,c,tt;

XL=CreateOleObject("Excel.Application");
XL.OlePropertySet("Visible",true);
my_workbooks=XL.OlePropertyGet("Workbooks");
my_workbooks.OleProcedure("Add"); // <- do tego jest OK
v1=my_workbooks.OlePropertyGet("Item",1);
v0=v1.OlePropertyGet("Worksheets") ;

P.S. Sorry for my english.
Grzegorz
 
T

The Real Andy

Jan 1, 1970
0
Is anyone familiar with getting Excel to automatically log data from a
RS-232 port, importing it automatically into a spreadsheet?

I saw it done once, and not sure how it was done, or if it was a hidden
macro or something.

I would use the visual basic editor in in excel, ctrl-f11 or something
like that. Not to sure if you have comm port access but a google will
reveal all no doubt.
 
T

The Real Andy

Jan 1, 1970
0
I would use the visual basic editor in in excel, ctrl-f11 or something
like that. Not to sure if you have comm port access but a google will
reveal all no doubt.

Just did a quick check, Alt-f11 will get you the vb editor. Add a user
form, then right click on the controls for the additional controls.
Check the Microsoft communications control option. Then drag the phone
icon onto your form. Now you have comms through excell.
 
M

Mike Page

Jan 1, 1970
0
Leeper said:
Is anyone familiar with getting Excel to automatically log data from a
RS-232 port, importing it automatically into a spreadsheet?

I saw it done once, and not sure how it was done, or if it was a hidden
macro or something.

Windisp (http://www.eclectic-web.co.uk/mike/zip/winlogic_v0-2.zip) has a
Trend function to generate CSV files from received RS232 data, but it's
not automatic. Well, I think it's cool anyway.

Regards,
Mike.
 
Top