DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to export diadem channels to an existing excel file with a certain configuration

Solved!
Go to solution

Hello,

 

I would like to export some channels from the Data Portal of Diadem  to an existing excel file. The excel file consists of many spreadsheets and each channel  should match one spreadsheet.

I´ve tried to use EXCELExport() function but it doesn´t work.(this function is designed for something else, it generates a new excel file). I´ve tried to access to each spreadsheet and copy the information throughout a for statement but this solution needs a lot of time. If somebody has any idea, please help.   

0 Kudos
Message 1 of 5
(5,445 Views)
Solution
Accepted by Ovidius

hey,

Use an "Ole connection" to modify   your excel file,

 

Exemple:

                  Dim excel
                  Dim excelbook
                  Set Excel = CreateObject("Excel.Application")
                  Excel.Visible = True
                  Set excelbook=Excel.Workbooks.Open("File path")
                  excelbook.Sheets(j).cells("A1")="value"  

                  Excel.quit

0 Kudos
Message 2 of 5
(5,434 Views)

Thanks, this solution works fine if there are a few channels to be exported. But I need to export a huge amount of data (many channels which contain large numbers) and this solution needs a lot of time to be completed. So, I am wondering if there is another way to solve the problem, (a function or something similar to ExcelExport ()) .....

0 Kudos
Message 3 of 5
(5,423 Views)

Hi Ovidius,

 

You have two options that I can think of.  You can export the data from the Data Portal to a temporary file, probably a CSV file, then load the data from file into the Excel template, OR you could stick with the Excel ActiveX approach but change to assigning a range of cells instead of individual cell values one at a time.

 

There is an Excel File Export option in DIAdem, but it always creates a new Excel file, it can not be used to export to an existing Excel file.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 5
(5,417 Views)

You can create a excel file with ExcelExport and after copy and paste the range of value in your existing file.

With ole connection you can copy , paste and add sheet in your file , it's very easy..

 

 

0 Kudos
Message 5 of 5
(5,410 Views)