From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

prevent user from editing excel sheet while running the operation

Hi,

 

I have an application which opens up an excel sheet to save the results.How can I lock it so that while the test is running & results are getting loaded into it,user would be unable to edit the excel?..Once the process gets over, it should allow user to edit it (if needed)..

0 Kudos
Message 1 of 8
(2,382 Views)

Hi mnx,

 

you can hide Excel by ActiveX calls, so the user will not even notice the Excel workbook/-sheet...

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(2,378 Views)

Hi GerdW,

 

Thanks for quick response..

 

I tried doing it but the excel sheet is not getting closed properly if I make it invisible..

0 Kudos
Message 3 of 8
(2,374 Views)

Hi mnx,

 

for me it runs nice. I hide the Excel sheet from the user and it gets closed properly when I want it to...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(2,370 Views)

Hi GerdW,

 

If I open that result excel file, I am getting a dialog box saying that "the file is already open..do you still want to open it?"..what could be wrong with the operation?

0 Kudos
Message 5 of 8
(2,356 Views)

Hi mnx,

 

that dialog pops up, when you try to open a file that is already opened by another Excel instance.

 

You have to save and close the workbook in Excel programmatically the same way you would do when using Excel "manually"!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(2,353 Views)

Hi GerdW,

 

I have saved and closed my file programmatically but that dialog still pops up...However, if I make my file visible, it doesnot pop up(weird but true..Smiley Wink)..Any thoughts on this? 

0 Kudos
Message 7 of 8
(2,345 Views)

I am getting error 1045 to be specific if I do so....

0 Kudos
Message 8 of 8
(2,321 Views)