05-06-2010 08:18 AM
I am building a duplicate system using Windows 7, LabView v9 and Excel v2007. The original system used WinXP, Excel 2007 and LabView v8.6. The issue is that the original system was able to bring Excel to the front when called from Labview using the property node -application-> visible. This new configuration runs Excel, loads the data, runs the macros but does not bring Excel to the front. The icon blinks in the Win7 taskbar and when selected displays over LabView. If I minimize the Labview window, Excel is there. This leads me to conclude that Excel is visible, as requested but will not come to the front until selected from the taskbar. The only differences, besides the versions, is the original system template files used the .xls extension in and was run in Excel in compatible mode. At the customers request, the new system uses the .xlsm extension on the Excel template files. I have tried using application.visible = True in the macro as well. Could be a setting in Labview? Could be a setting in Excel? Could be .xls vs. .xlsm? Or an issue with Windows 7 and the newer version of Labview.
HP workstation - Labview v9 - Windows 7 - Excel 2007 sp2
Thank you in advance
Stephen
Solved! Go to Solution.
05-06-2010 08:40 AM
This is how you do it.You may not need the WindoState property depending on what you need to do.
05-06-2010 11:52 AM
05-06-2010 12:05 PM
05-06-2010 12:54 PM
05-06-2010 03:28 PM
I had the same problem when using Excel 2007 and Windows 7 and still don't know what causes it.
I just used a few property nodes to set the window as maximised then minimised and then normal and visible as a workaround that ends up showing excel maximised for me.
Would be nice to know what causes that behavior and if there is a "correct" way to handle it.
05-06-2010 03:57 PM
05-06-2010 06:03 PM
I will try the windowstate change. Were these done in succession? (i.e. property node -> property node -> property node) Or were they done along the way such as call the ActiveX open and a property node then in a worksheet modification area etc. so there was some time between calls?
I am not sure about the API since the discussion there is with regard to DDE. (Taken from the link document: If you want to call a DLL that contains ActiveX objects, use the Automation Open VI with the Property Node and the Invoke Node.). I am calling Excel as an application not as a library call unless I am mistaken, which I could certainly be. Are you thinking that once Excel is active through the Automation Open VI that a DLL call to set the application visible would work? I may be trying this already but in Excel through the use of the macro I call from LabView. It contains application.visible = True at the beginning before reading files and plotting data.
I may try sprinkling Property node with application->visible in various locations in the LabView diagram as I do update cells after the call to the plot macro. The puzzle for me is the blinking Excel icon in the task bar. This means active and running but not visible or something wrong as well. There are a few #VALUE cells if not all test in the system are run. Again not a problem in Excel 2007-WinXP-LV8.6
Thank you again one and all.
05-06-2010 10:19 PM
sfm-dss wrote:I am not sure about the API since the discussion there is with regard to DDE. (Taken from the link document: If you want to call a DLL that contains ActiveX objects, use the Automation Open VI with the Property Node and the Invoke Node.). I am calling Excel as an application not as a library call unless I am mistaken, which I could certainly be. Are you thinking that once Excel is active through the Automation Open VI that a DLL call to set the application visible would work? I may be trying this already but in Excel through the use of the macro I call from LabView. It contains application.visible = True at the beginning before reading files and plotting data.
Are you referring to the comment I made regarding the link to the Windows API functions? Those have nothing to do with DDE. They call Windows API functions. Like FindWindow and SetWindowPos. These work for any window. You could call these after you've opened Excel and force the window to the top.
05-07-2010 01:09 PM
sfm-dss wrote:I will try the windowstate change. Were these done in succession? (i.e. property node -> property node -> property node) Or were they done along the way such as call the ActiveX open and a property node then in a worksheet modification area etc. so there was some time between calls?
I just used something like this in any place where i would normally just make excel visible. Works for me on Win7 x64 even though i'm not really sure why.
On WinXp i never had any problems with just using the visible property with a single windowstate change or even without one.