ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Launching and closing Excel from CVI 6.0

I have two questions:
1) when I launch Excel from CVI, Excel will be brought to the top maximized. I need to switch back to my own panel to continue. Is there a way in which I can launch Excel with it minimized?
2) when I connected the DDEServer, I cut and pasted the callback function from the example Ddedemo to handle the two messages: DDE_DISCONNECT and DDE_DATAREADY. But when I closed Excel manually, I got an error from function DisconnectFromDDEServer() when handling the DDE_DISCONNECT message. The error code is (-12): NoConnectionEstablished.

Could somebody help me out? Thanks in advance
0 Kudos
Message 1 of 3
(3,254 Views)
Instead of using the older DDE method, have you looked at using ActiveX? Look at the Excel ActiveX demos that ship with CVI 6.0: excel97demo.prj or excel2000dem.prj. They launch Excel but leave the CVI app active. If you don't have Visibility checked on the demo panel, Excel isn't shown but still runs.
Message 2 of 3
(3,254 Views)
Hi,

you can set the panel floating style to "Always" or "When application is active"(Panel properties, Other attributes). So your panel will be on front whatever you do. But this has one disadvantage: FileSelectPopups from Excel will not come to front. So before you call a Popup from Excel you should set the visibility attribute of your panel to 0 and afterwards again to 1
0 Kudos
Message 3 of 3
(3,254 Views)