NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

excel check if workbook is in use

Hi Im using CVI2009 and the Excel 2000 instrument How do i check if a workbook is in use?
Help share your knowlegde
0 Kudos
Message 1 of 4
(1,896 Views)

Hi,

 

I'm not sure if this is exactly what you need but the Call Executable step can be used to issue a DOS 'Tasklist' command.  If Excel is open, the STD Out should have 'EXCEL.EXE' listed if Excel is running.  Is this what you mean by 'in use?'.

 

Thanks,

Jim

0 Kudos
Message 2 of 4
(1,889 Views)

Im im looking for is to find out if i have write permissions on a specific workbook.

If i dont have write permissions and the file is opened by another user i would like you know who the user is and worn my user.

Help share your knowlegde
0 Kudos
Message 3 of 4
(1,886 Views)

Hello Shako,

What you need to do is open LabWindows/CVI and create an ActiveX controller by going to Tools>Create ActiveX Controller.

You will be able to build a library for the Excel ActiveX Server: called Microsoft Excel Object Library.

From there you can select which methods and properties will be placed into a C wrapper.

After the previous operation is complete you will find a .obj file in your project folder.

 

At this point you can use the functions that were created in CVI or load them into TestStand.

 

Too load them into TestStand open up a CVI Action step and select the created object library file as the code module. From there the function list will populate with all the functions available in the library.

You will need to look at the available ActiveX Automation Server functions available to control Excel and find the ones you need for your specific application.

Jacob R. | Applications Engineer | National Instruments

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