09-12-2014 10:55 AM
I am writing a VBA script in Excel to read TDMS files. I am able to load the files, but some channels have more than a million rows. When I open a TDMS file by clicking on it, I get the “Select Index” dialog box if the number of rows is too high for Excel. I’d like to use the ImportFile method in silent mode and if the number of rows in the file is too high, automatically read the file into two Excel sheets. To do this, I think I need to know the number of rows in the file so I can calculate an index and read the file into the 2nd sheet using this index. I also need to know how to set the index property to a value. The following code works to open the file, but I'm having trouble getting the methods and properties defined in http://www.ni.com/white-paper/10207/en/ to work.
Set obj = Application.COMAddIns.Item("ExcelTDM.TDMAddin")
Call obj.Object.ImportFile(FilePath)
09-15-2014 10:21 AM
Hi LMMiller,
The method to load a selected row range from a TDMS file does not yet exist in the TDM Excel Add-in. This was requested recently, and R&D is looking into how much effort it would take to add it. The TDM Excel Add-in is not tied to the DIAdem release cycle, so new features could appear at any time.
Stay tuned,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-15-2014 01:13 PM
Thanks.
10-25-2016 04:44 PM
Is there any update on this ability?
10-26-2016 06:53 PM
Hello,
We really don't know if there is anything about this. Unfortunately, I guess it will be required to monitor the future releases "release notes" to find out if the functionality was implemented, but even knowing R&D knows about this, we don't have a way to predict when they will work on it.
Hope I could provide a better insight.
Regards,
10-27-2016 09:03 AM
Ok, thanks.
10-27-2016 12:12 PM
Hello LMMiller,
I have checked with the R&D team, and adding this functionality is not in the development plan for the foreseeable future.
An alternative way to get where you need to be is to load the data to DIAdem first and "prepare" it for the Excel load process. You could partition all channels with more than 1,000,000 values using a Script and then save a new file that has additional, indexed channels for the channels that were partitioned (so a channel with 3 million values that is called "Test Data" would be separated into three channels called "Text Data 1", "Test Data 2" and "Test Data 3", each 1,000,000 values long). The GetValues and SetValues functions should do this with good performance.
For the foreseeable future, I think that's the best way to automate that process. The TDM Excel Add-in seems to work well for most customers, so this feature request is not high on the R&D list. You could list this feature request in the DIAdem Ideas forum and have people vote on it to gauge interest from the larger user community.
I hope this helps,
Otmar