LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set an already opened Excel application in the right side of the screen

Solved!
Go to solution

Have anybody got a tip for that?

0 Kudos
Message 1 of 4
(1,995 Views)

Hello Michael,

Yes, I have!

I assume that you are not asking on how to move an Excel windows from Excel (use VBA) or just using your mouse of keyboard (Windows key + right arrow), but from LabVIEW. It's tricky, but the same way as from any other programming language used to move an external application on Windows.

 

Windows OS has a window manager built-in, called "Desktop Window Manager" on recent Windows versions. You can access it's functionality by calling functions in user32.dll or .NET. You most likely need FindWindowA to get handle of your Excel window, and then functions like SetWindowPlacement and SetWindowPos to move it around.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
Message 2 of 4
(1,947 Views)

I'm not sure I understand what you mean.
Can I use labview to move Excel or do I have to use an external program ?

Cause I would like to use labview 🙂 

I know how to move labview from c#, and I could write an EXE in c# and call that from Labview, but what if I wanted to use labview alone?

 

Michael

0 Kudos
Message 3 of 4
(1,922 Views)
Solution
Accepted by topic author Michael.Koppelgaard

Sorry, I'll try to explain better what I meant. You can use any programming language that can access Windows API to move Excel.

Good to know you already know the approach to do so in C# (assuming you are using Windows API and not a built-in LabVIEW function). Doing it in LabVIEW is basically the same.

 

Depending on what exact approach you took and how proficient you are in LabVIEW, the idea of creating c# code to do so, compiling it into a dll (exe works as well), and then calling that from LabVIEW using the Call Library Function node could actually be quicker for you to implement.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
Message 4 of 4
(1,917 Views)