LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

activex or dde

I want to exchange data between one or more excel worksheets and a
cvi-application. I need to get a message whenever a value in excel has been
changed. I'm not sure what's the best way (and a simple way) to do it. Is it
better to use dde functions or activex.
Is it possible to control the access on the data via cvi (password or other)
so that a user cannot simply open the worksheet with excel and change the
contents.

Thanks for your help

Norbert Rieper
0 Kudos
Message 1 of 4
(3,631 Views)
Norbert

When you save an excel worksheet you can set a password for it when using the function Excel_WorkbookSaveAs.

I do not know of a way to 'watch' a value in excel to let you know when it has been changed. What you can do is read the value in a loop to check if it has changed.

Brian
0 Kudos
Message 2 of 4
(3,631 Views)
bman wrote in message news:<506500000005000000DA410000-999158726000@exchange.ni.com>...
> Norbert
>
> When you save an excel worksheet you can set a password for it when
> using the function Excel_WorkbookSaveAs.
>
> I do not know of a way to 'watch' a value in excel to let you know
> when it has been changed. What you can do is read the value in a loop
> to check if it has changed.

Google only showed me two articles in this thread and not the original
question, so this may not help. You can 'watch' a value in Excel using
DDE.

Roger Abbott,
RHA (Minisystems) Ltd.
http://www.rhaminisys.com
DDE ActiveX controls and FAQ
Other Freeware and Shareware
0 Kudos
Message 4 of 4
(3,631 Views)
Norbert,

I recommend that you use ActiveX for the following reasons.

1. ActiveX the connectivity technology that Microsoft is supporting moving forward. DDE is more or less no longer supported.

2. There are a limited number of things you can do with Excel via DDE. Virtually all functionality in Excel is exposed programmatically via the ActiveX interface.

3. CVI 6.0 provides excelreport.fp. This wrapper on top of the ActiveX interface provides a cleaner interface to the functionality that you are most likely going to want to use from a typical CVI application. Note that you can use these functions together with the full ActiveX Excel interface. You can find excelreport.fp in \CVI\Samples\ActiveX\Excel.

As far as controlling the access, you could go thro
ugh Windows2000 security for the file. You would need to use the Win32 SDK to do this (requires CVI FDS). This is probably overkill unless you are trying to protect the file from malicious users. If you just want to make it not obvious that it is an Excel spreadsheet, a quick and dirty solution would be to rename the file to have a different extension before and after you access it from your CVI program.

David Rohacek
National Instruments
0 Kudos
Message 3 of 4
(3,631 Views)