Message Boards Message Boards

Dynamic link with Excel

Posted 1 year ago

Hello, I've created in my nb a simple dynamic link with excel as following

Needs["ExcelLink`"]
v = Dynamic[Refresh[ExcelRead["C7:C20"], UpdateInterval -> 1]]

the variable v is updated continuously as per change of excel cells. The problem that I have is to re-use v as a list of number. For example, I would like to plot v in a simple list line plot

ListLinePlot[v]

but I get the following error

ListLinePlot::lpn: {28565.,28565.,28560.,28560.,28560.,28570.,28570.,28570.,28570.,28570.,28570.,28570.,28570.,28565.} is not a list of numbers or pairs of numbers.

How can I manipulate v such that I can use it as any other list of numbers? Thanks Best regards Paolo

POSTED BY: Tarpanelli Paolo
2 Replies

thank you. it works

POSTED BY: Tarpanelli Paolo
Posted 1 year ago

You are setting v to a Dynamic expression. Dynamics are special "objects" that display things in the front end. ListLinePlot won't work with such objects--it needs a list of points. To fix this, you need to put the assignment inside the Dynamic:

Dynamic[v = Refresh[ExcelRead["C7:C20"], UpdateInterval -> 1]]
POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract