11-16-2010 05:21 AM
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.
Solved! Go to Solution.
11-16-2010 07:35 AM
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
11-16-2010 10:17 AM
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 ()) .....
11-16-2010 11:28 AM
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
11-16-2010 12:40 PM
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..