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: 

How do I stop excel from opening when I run the following code?

I get the following error when I run your code with other VI's


Error -2146827284 occurred at Unknown System Error in NI cDAQ_2.vi->PSU Test_2.vi

This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.

Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2146827284) or for its hexadecimal representation (0x800A03EC).

Download All
0 Kudos
Message 21 of 22
(341 Views)

Search the forums and or google for that error code (without the minus sign).  There seem to be a number of possible causes.

 

You need to do some debugging yourself.  Put some probes in the code to see exactly where the error is first occuring.  That can give you a clue as to what is going on.

 

You have a lot of odd file open, get file position, set position to end, and close in between the the write to spreadsheet files.  You certainly don't need to get the file position.  You are just setting it to the end.  But simpler yet would be to use a Write to Spreadsheet File, and wire a 1-D array of strings to the 1-D input.  Then you don't have to do all the extra string concatenation.

 

If you do use the Write to File functions, don't forget to wire up the error wires there also.

 

Another issue, you are mixing and matching text file and Excel functions with your File.  Your file writes create a text file.  But then you go and open it up in Excel.  That is going to import the text file into Excel and start treating it like a real Excel spreadsheet.  If you later go and run  your code on that same file again, you are going to wind up corrupting the .xls file by putting in more text at the end of a proprietary .xls file format.

0 Kudos
Message 22 of 22
(335 Views)