DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read and write Excel file from vb script

Hello guys,

 

I am a DIAdem 2017 user and I mainly use scripts to perform operations for automation reasons.

 

I am trying to set up a script that is capable of reading the excel spreadsheet's cell content (for a given file path, sheet name and cell range), transferring the content into an array in Diadem.

 

I started looking at CreateObject(...) and CreateUDI(...). However in the documentation there is a very little about handling an excel file from diadem script.

 

Do you have some examples that show how someone can handle the excel file, read and write the data inside the cells and save the file eventually.

 

Thank you

0 Kudos
Message 1 of 2
(2,360 Views)

Hi casciolal,

 

In DIAdem 2019 we released a new object that makes reading and writing individual cells in Excel files much easier.  Prior to that, you really only have cell by cell read/write access using the Excel COM object, which can have some instancing struggles.  If all you wanted to do was read Excel data, then a DataPlugin would be your best bet.

 

Any chance you could try DIAdem 2019?  I can send ActiveX code for Excel, but not by the end of business today.

 

Brad Turpin

Senior Technical Support Engineer

National Instruments

0 Kudos
Message 2 of 2
(2,275 Views)