LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EXCEL + ActiveX + error "-2146827284" (but not the string length limit)

Solved!
Go to solution

Dear all,

 

First of all thanks for your help !

 

I'm experiencing a strange error with excel activeX: "-2146827284" !

 

Why strange? Because my export function works perfectly on a computer but not on another ... (both are windows 7 + Excel 2007)

 

How my application works :

I must read an excel spreadsheet that stores measurements done with different types of instruments.

For each instrument type I must create a specific spreadsheet with its measurements.

 

As an example :

1 excel spreadsheet with many measurements from 4 different type of instruments

SHOULD GIVE

4 excel spreadsheets containing the measurements of each instrument (1 spreadsheet for one instrument type).

 

Hope I'm clear ...

 

Why I'm doing it with LV ? Because it is fun !

 

Now here are some snapshoot.

 

1-where the bug appears :

errLV.PNG

 

2- The message I get (translated from french to english):

errLVmsg.PNG

 

Additionnal information :

- The string size I write in excel cells is 6 characters max. Plus I set a condition to return an error if the string length is >900 characters.

 

 

Many thanks for your help !

 

 

 

0 Kudos
Message 1 of 6
(8,669 Views)

The error you are showing doesn't seem to imply anything about string length. What led you to believe it has something to do with the string length. The error appears to be caused by the fact that you either have the wrong path (perhaps you're writing to a network drive), or the file is already open in Excel.

0 Kudos
Message 2 of 6
(8,629 Views)

Hi,

 

In a first time what led me to think it was a string length problem was an old thread I found by searching for -2146827284 error code.

 

I thought that there should some phantom characters added due to an improper conversion. So I set a test to check the string lenght. Now that I'm sure it is not the string length I have no more clue.

 

Plus what does really upset me it is that the same application work fine on a computer but not on another.

 

Thanks

 

 

 

0 Kudos
Message 3 of 6
(8,624 Views)
Solution
Accepted by topic author ro98000

SOOOOOO simple ...

 

It was just the folder name...

I coded the folder name as a constant for dev purpose. And I didn't pay attention that the folder name was not the same on both computers !!!

"one letter missing = one week losed"

Arrrgh

 

sorry all of you for bothering

Message 4 of 6
(8,610 Views)

This is why you should avoid "magic strings" like absolute paths inside of code. Smiley Wink

0 Kudos
Message 5 of 6
(8,606 Views)

I had a slightly differnet problem that caused the same error.  My .xlsx file was corrupt so it would appear that this error is related to Excel not being able to open the file.

Message 6 of 6
(8,048 Views)