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

I want to read data directly from .xlsm files using activex. I donot want to convet the files to .xls.

Can you please tell if its possible to read data from .xlsm in version 8.5.1 ?

Will it be mandatory to buy report generation toolkit or is there an alternavtive way to do it.

Please help !!!

0 Kudos
Message 1 of 21
(5,412 Views)
Solution
Accepted by topic author sharmasargam9@gmail.com

Hi sharmasargam,

 

yes, that's possible without buying RGT! (Just joking: You might buy XLR8 toolkit instead :D)

 

Use just ActiveX nodes to interact with Excel.

Search the forum for "Excel LabVIEW ActiveX" and you will find a lot of example VIs…

Best regards,
GerdW


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

Hie 

First of all thanks a lot for your reply. I have a program in which i am reading the data from .xls format but when i use it to read .xlsm format it shows error. Can yoi suggest what to do. 

 

 

0 Kudos
Message 3 of 21
(5,383 Views)

Hi sharmasargam,

 

I have a program in which i am reading the data from .xls format but when i use it to read .xlsm format it shows error.

So little information…

Which "program" do you use?

How do you read this XLS files? (Using which functions?)

Which error do you get when reading XLSM files instead?

 

You need to (learn to) provide enough information to allow us to help you!

Best regards,
GerdW


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

Okk thank you ! 

I am sorry for that. I will provide the entire information by tomorrow. hope to get a reply from you Tomorrow 🙂

0 Kudos
Message 5 of 21
(5,363 Views)

Well, there is another way.  If you rename the XLSX to ZIP, you can see the underlying data and how it is stored.  The data from an Excel sheet is stored in XML format.  It should be fairly simple to read in the XML file and do what you will with it. 

aputman
Message 6 of 21
(5,342 Views)

I have attached the zip file which has the .xlsm file from which i want to read the data.

Get Excel Values1.vi is the one i am using to get data dat from .xls files.

How can I use it to get data from .xlsm files ?

I want to read data directly from this .xlsm file without changing it to any other format.

 

Please help!

0 Kudos
Message 7 of 21
(5,309 Views)

Hi sharmasargam,

 

I get error 97 after the "Find" operation inside GetXL_CellValues_2D_String.vi - regardless of the Excel file format (xlsm or xls)! Did this VI ever work for you?

 

Why do you search for an empty string inside a range?

Best regards,
GerdW


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

Yes, It works for me for .xls.

I am sending you the snapshops of what i am adding as a range and string and what data I am getting from .xls.

This is exactly what i want from .xlsm.

But i get the same error code 97 with  .xlsm.

0 Kudos
Message 9 of 21
(5,301 Views)
Solution
Accepted by topic author sharmasargam9@gmail.com

Hi sharmasargam,

 

when I use your VI with the settings from your screenshots I still get error97 regardless of the filetype (xlsm or xls). Did this VI ever work for you - with the settings you gave us? (Btw. I'm using Office2010.)

 

Btw. all your Close functions don't work as expected: they should close worksheet/workbook/application regardless of the error state at their input (as any other Close operation in LabVIEW)! It's a shame I have to kill Excel using the task manager after running your VIs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 21
(5,297 Views)