LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to read data from a .xlsm file in LV 8.5.1 WITHOUT USING a report genration toolkit.

Solved!
Go to solution

Yes as i have sent in the screenshot it works for me in case of .xls files.

Can you please suggest a way I can do this. I am new to labview and i cant find any suitable solution.

0 Kudos
Message 11 of 21
(2,296 Views)

Hi sharmasargam,

 

simple solution: use XLS files…

 

More advanced solution: debug the problem using Excel VBA. Do the very same steps with VBA as you want to achieve in your LabVIEW code. Check for errors in VBA…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 21
(2,295 Views)

i have attached the VI i am using to read data from .xls file. It works perfectly with .xls format.

However now i need to work with .xlsm files and i want to use them directly (without converting into  .xls fromat.

When i use .xlsm i get the error message code -2146827284

"Exception occured in Microsoft Excel: Select method of Range class failedHelp Path is xlmain11.chm and context 0 in Excel Get Data Specified Field.vi".

I have attached the VI and a screenshot of error message.

please help !!

0 Kudos
Message 13 of 21
(2,281 Views)

This is a slightly different answer to your question.  Yes, it (probably) is possible to read data from an .xlsm file in LV 8.5.1 without using the RGT.  However, in LabVIEW 2016 with the RGT, not only can you read it, but you can write the code to read it in under 5 minutes.  If Time = Money, this may be "cost-effective".

Simple Excel.png

Incidentally, it returns an array of 11 rows, 68 columns in under 2 seconds.

 

Bob Schor

 

0 Kudos
Message 14 of 21
(2,280 Views)

I just posted code in response to your earlier message ("Is it possible to read .xlsm") showing my solution using the RGT that I coded in under 5 minutes and that worked the first time.  If doing this is important to you, you might consider upgrading to a more modern LabVIEW Version + the Report Generation Toolkit.

 

Bob Schor

0 Kudos
Message 15 of 21
(2,276 Views)

Hi Bob,

 

the problem is not the basic data read operation from an excel sheet - it's the additional Find operation in this special instance of the polymorphic GetXL_CellValues VI! Other instances just read the data without searching a range first…

That's why I told the OP to do some VBA debugging of the code (s)he tries to use…

 

(Also the OP seems to be limited to LV2012/2013, when the RGT wasn't included for free.)

Best regards,
GerdW


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

Can you please help me do it in version 8.5.1 without using the RGT. I need it urgently ! I have posted the Vi i am trying to use. 

 

0 Kudos
Message 17 of 21
(2,277 Views)
Solution
Accepted by topic author sharmasargam9@gmail.com

Hi sharmasargam,

 

please keep discussion in one thread, avoid double posts on the same problem!

(I moved your other message and Bob's answer into this thread!)

 

Can you please help me do it in version 8.5.1 without using the RGT. I need it urgently ! I have posted the Vi i am trying to use.

You got a lot of answers so far!

Did you do some debugging of the code you want to use, also in Excel VBA?

 

On your last VI upload:

check.png

This one runs fine. I really don't know why you want to read a Range "Select" and some "Cells" properties…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 18 of 21
(2,270 Views)

Yes i tried but i cudnt really fix it.

I tried using another Vi now. But it gives error message code -2146827284

"Exception occured in Microsoft Excel: Select method of Range class failedHelp Path is xlmain11.chm and context 0 in Excel Get Data Specified Field.vi".

 

I posted this Vi and error code screen shot as a separate question in the thread u merged

0 Kudos
Message 19 of 21
(2,263 Views)

I will try to do it by deleting the select option. 

Actually i want to look for a value in a column. Then corresponding to the row address of this value. 

Read values from other columns. 

Since i am not very good LabVIEW i might ne mixing things. 

 

0 Kudos
Message 20 of 21
(2,257 Views)